]> granicus.if.org Git - icinga2/commitdiff
Add example timeperiods.
authorMichael Friedrich <Michael.Friedrich@netways.de>
Tue, 15 Oct 2013 20:50:07 +0000 (22:50 +0200)
committerMichael Friedrich <Michael.Friedrich@netways.de>
Tue, 15 Oct 2013 20:52:03 +0000 (22:52 +0200)
fixes #4839

doc/4.3-object-types.md
etc/icinga2/conf.d/Makefile.am
etc/icinga2/conf.d/timeperiods.conf [new file with mode: 0644]

index 9162ce21d0520f0eeaa8ccac9e0c7d6e27e78592..8e662dd3c5fe828a32c87b52a6ca60fdd23ac6eb 100644 (file)
@@ -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.
+
+
 ### <a id="objecttype-consolelogger"></a> ConsoleLogger
 
 Specifies Icinga 2 logging to the console.
index 2a8a0551b69e4f5e21b1d458323c7485fb349419..dc43107c557e35db5e1a2d4047272e6c897d3819 100644 (file)
@@ -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 (file)
index 0000000..1bc2f3f
--- /dev/null
@@ -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 = {
+  }
+}
+