From: Michael Friedrich Date: Tue, 15 Oct 2013 20:50:07 +0000 (+0200) Subject: Add example timeperiods. X-Git-Tag: v0.0.3~112 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91afc36b3ae8b14f354d7b0bdc3990cfeb2e12da;p=icinga2 Add example timeperiods. fixes #4839 --- diff --git a/doc/4.3-object-types.md b/doc/4.3-object-types.md index 9162ce21d..8e662dd3c 100644 --- a/doc/4.3-object-types.md +++ b/doc/4.3-object-types.md @@ -217,7 +217,18 @@ when notifications should be sent out. Example: - TODO + object TimePeriod "24x7" inherits "legacy-timeperiod" { + display_name = "Icinga 2 24x7 TimePeriod", + ranges = { + "monday" = "00:00-24:00", + "tuesday" = "00:00-24:00", + "wednesday" = "00:00-24:00", + "thursday" = "00:00-24:00", + "friday" = "00:00-24:00", + "saturday" = "00:00-24:00", + "sunday" = "00:00-24:00", + } + } Attributes: @@ -227,6 +238,10 @@ Attributes: methods |**Required.** The "update" script method takes care of updating the internal representation of the time period. In virtually all cases you should just inherit from the "legacy-timeperiod" template to take care of this setting. ranges |TODO +The `/etc/icinga2/conf.d/timeperiods.conf` file is usually used to define +timeperiods including this one. + + ### ConsoleLogger Specifies Icinga 2 logging to the console. diff --git a/etc/icinga2/conf.d/Makefile.am b/etc/icinga2/conf.d/Makefile.am index 2a8a0551b..dc43107c5 100644 --- a/etc/icinga2/conf.d/Makefile.am +++ b/etc/icinga2/conf.d/Makefile.am @@ -6,7 +6,8 @@ CONFIG_FILES = \ generic-host.conf \ generic-service.conf \ localhost.conf \ - macros.conf + macros.conf \ + timeperiods.conf install-data-local: @if [ ! -e $(icinga2confdir) ]; then \ diff --git a/etc/icinga2/conf.d/timeperiods.conf b/etc/icinga2/conf.d/timeperiods.conf new file mode 100644 index 000000000..1bc2f3f8a --- /dev/null +++ b/etc/icinga2/conf.d/timeperiods.conf @@ -0,0 +1,35 @@ +/** + * Sample timeperiods for Icinga 2 requiring + * 'legacy-timeperiod' template from the ITL. + */ + +object TimePeriod "24x7" inherits "legacy-timeperiod" { + display_name = "Icinga 2 24x7 TimePeriod", + ranges = { + "monday" = "00:00-24:00", + "tuesday" = "00:00-24:00", + "wednesday" = "00:00-24:00", + "thursday" = "00:00-24:00", + "friday" = "00:00-24:00", + "saturday" = "00:00-24:00", + "sunday" = "00:00-24:00", + } +} + +object TimePeriod "8x5" inherits "legacy-timeperiod" { + display_name = "Icinga 2 8x5 TimePeriod", + ranges = { + "monday" = "09:00-17:00", + "tuesday" = "09:00-17:00", + "wednesday" = "09:00-17:00", + "thursday" = "09:00-17:00", + "friday" = "09:00-17:00", + } +} + +object TimePeriod "none" inherits "legacy-timeperiod" { + display_name = "Icinga 2 none TimePeriod", + ranges = { + } +} +