Hi,
I have read through the docs:
https://icinga.com/docs/icinga2/latest/doc/08-advanced-topics/#timeperiods
And other threads:
https:// community.icinga. com/t/set-time-period-for-all-services-belonging-to-a-certain-host/673
https:// community.icinga. com/t/failing-to-understand-how-notification-time-period-and-service-check-time-period-work-together/2818
But I can’t follow how to weld check_period and Hosts together; it’s just not fitting in my head.
So I have this host:
object Host "cas-test.internal" {
/* Import the default host template defined in `templates.conf`. */
import "generic-host"
/* Specify the address attributes for checks e.g. `ssh` or `http`. */
address = "cas-test.internal"
vars.http_vhost = "$address$"
/* Set custom attribute `os` for hostgroup assignment in `groups.conf`.
vars.os = "Linux"*/
/* Define http vhost attributes for service apply rules in `services.conf`. */
vars.http_vhosts["http"] = {
http_uri = "/login?user=username&pass=passwd"
}
/* Define notification mail attributes for notification apply rules in `notifications.conf`. */
vars.notification["mail"] = {
/* The UserGroup `icingaadmins` is defined in `users.conf`. */
groups = [ "icingaadmins" ]
}
}
And this timeperiod defined:
object TimePeriod "tst-cas" {
import "legacy-timeperiod"
display_name = "Icinga 2 tst-cas TimePeriod"
ranges = {
"monday" = "08:05-19:55"
"tuesday" = "08:05-19:55"
"wednesday" = "08:05-19:55"
"thursday" = "08:05-19:55"
"friday" = "08:05-19:55"
}
}
How do I apply timeperiod “tst-cas” as the only times to run checks on this host and its services?
I’ve tried adding check_period = “tst-cas” to the Host block and also period = “tst-cas” the vars.notification block.
Any help appreciated.
Thank you.