]> granicus.if.org Git - icinga2/commitdiff
Update manual test config for notifications
authorMichael Friedrich <michael.friedrich@netways.de>
Tue, 5 Aug 2014 14:37:30 +0000 (16:37 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Tue, 5 Aug 2014 14:37:30 +0000 (16:37 +0200)
refs #6479

test/config/5927.conf [new file with mode: 0644]
test/config/5980.conf
test/config/6105.conf
test/config/6479.conf [new file with mode: 0644]
test/config/6608.conf [new file with mode: 0644]
test/config/templates.conf

diff --git a/test/config/5927.conf b/test/config/5927.conf
new file mode 100644 (file)
index 0000000..c584a11
--- /dev/null
@@ -0,0 +1,46 @@
+
+object EventCommand "5927-handle" {
+  import "plugin-event-command"
+  command = "echo \"event handler triggered.\""
+}
+
+object NotificationCommand "5927-notification" {
+  import "plugin-notification-command"
+  command = "echo \"notification triggered.\""
+}
+
+object HostGroup "5927-bar" {
+  assign where match("5927-keks*", host.name)
+}
+
+object Host "5927-keks" {
+  import "test-generic-host"
+  event_command = "5927-handle"
+  address = "1.2.3.4"
+}
+
+apply Service "5927-foo" {
+  import "test-generic-service"
+  check_command = "ping4"
+  event_command = "5927-handle"
+  assign where "5927-bar" in host.groups
+}
+
+apply Notification "5927-host-notification" to Host {
+  import "test-mail-host-notification"
+  command = "5927-notification"
+  assign where "5927-bar" in host.groups
+}
+
+apply Notification "5927-service-notification" to Service {
+  import "test-mail-service-notification"
+  command = "5927-notification"
+  assign where "5927-bar" in host.groups
+}
+
+object ServiceGroup "5927-bar" {
+  assign where service.name == "5927-foo"
+}
+
+
+
index ea53c000fbcab8ea16cfd49f9fe8022a4f89421d..494b5bd5bf9438233f87a364c40fd3e076e521c8 100644 (file)
@@ -38,6 +38,10 @@ apply ScheduledDowntime "5980-test-service-downtime" to Host {
   import "5980-test-downtime"
   comment = "Scheduled host downtime for tests"
 
+  ranges = {
+    tuesday = "09:37-09:40"
+  }
+
   assign where host.name == "5980-host"
 }
 
@@ -45,6 +49,10 @@ apply ScheduledDowntime "5980-test-service-downtime" to Service {
   import "5980-test-downtime"
   comment = "Scheduled service downtime for tests"
 
+  ranges = {
+    tuesday = "09:37-09:40"
+  }
+
   assign where host.name == "5980-host"
 }
 
index 32a803628844a486511c7cac525c060104284b4d..6bfccff5812962098640b31fdf3d2da45c5bca2e 100644 (file)
@@ -2,6 +2,7 @@
 
 object HostGroup "6105-bar" {
   assign where match("6105-keks*", host.name)
+  vars.foo = "bar"
 }
 
 object Host "6105-keks" {
@@ -17,6 +18,7 @@ apply Service "6105-foo" {
 
 object ServiceGroup "6105-bar" {
   assign where service.name == "6105-foo"
+  vars.bar = "foo"
 }
 
 
diff --git a/test/config/6479.conf b/test/config/6479.conf
new file mode 100644 (file)
index 0000000..787f20d
--- /dev/null
@@ -0,0 +1,46 @@
+
+object EventCommand "6479-handle" {
+  import "plugin-event-command"
+  command = "echo \"event handler triggered.\""
+}
+
+object NotificationCommand "6479-notification" {
+  import "plugin-notification-command"
+  command = "echo \"notification triggered.\""
+}
+
+object HostGroup "6479-bar" {
+  assign where match("6479-keks*", host.name)
+}
+
+object Host "6479-keks" {
+  import "test-generic-host"
+  event_command = "6479-handle"
+  address = "1.2.3.4"
+}
+
+apply Service "6479-foo" {
+  import "test-generic-service"
+  check_command = "ping4"
+  event_command = "6479-handle"
+  assign where "6479-bar" in host.groups
+}
+
+apply Notification "6479-host-notification" to Host {
+  import "test-mail-host-notification"
+  command = "6479-notification"
+  assign where "6479-bar" in host.groups
+}
+
+apply Notification "6479-service-notification" to Service {
+  import "test-mail-service-notification"
+  command = "6479-notification"
+  assign where "6479-bar" in host.groups
+}
+
+object ServiceGroup "6479-bar" {
+  assign where service.name == "6479-foo"
+}
+
+
+
diff --git a/test/config/6608.conf b/test/config/6608.conf
new file mode 100644 (file)
index 0000000..e24d4c8
--- /dev/null
@@ -0,0 +1,16 @@
+
+
+object Host "6608-host" {
+  import "test-generic-host"
+  vars.BUMSTI = "keks"
+  vars.bumsti = "schaschlik"
+}
+
+object Service "6608-service" {
+  import "test-generic-service"
+  check_command = "dummy"
+  host_name = "6608-host"
+  vars.DINGDONG = "$BUMSTI$"
+  vars.dingdong = "$bumsti$"
+}
+
index 983062b91da8e34a27391e2f4014fc24b7f0a8a9..7fb27abcbf9cb6540597d9b9087aff1803d4cbf4 100644 (file)
@@ -12,3 +12,70 @@ template Host "test-generic-host" {
   check_command = "hostalive"
 }
 
+template User "test-generic-user" {
+
+}
+
+template Notification "test-mail-host-notification" {
+  command = "mail-host-notification"
+
+  states = [ Up, Down ]
+  types = [ Problem, Acknowledgement, Recovery, Custom,
+            FlappingStart, FlappingEnd,
+            DowntimeStart, DowntimeEnd, DowntimeRemoved ]
+
+  period = "test-24x7"
+
+  user_groups = [ "test-icingaadmins" ]
+}
+
+/**
+ * Provides default settings for service notifications.
+ * By convention all service notifications should import
+ * this template.
+ */
+template Notification "test-mail-service-notification" {
+  command = "mail-service-notification"
+
+  states = [ OK, Warning, Critical, Unknown ]
+  types = [ Problem, Acknowledgement, Recovery, Custom,
+            FlappingStart, FlappingEnd,
+            DowntimeStart, DowntimeEnd, DowntimeRemoved ]
+
+  period = "test-24x7"
+
+  user_groups = [ "test-icingaadmins" ]
+}
+
+
+/* users */
+
+object User "test-icingaadmin" {
+  import "test-generic-user"
+
+  display_name = "Test Icinga 2 Admin"
+  groups = [ "test-icingaadmins" ]
+
+  email = "icinga@localhost"
+}
+
+object UserGroup "test-icingaadmins" {
+  display_name = "Test Icinga 2 Admin Group"
+}
+
+/* timeperiods */
+object TimePeriod "test-24x7" {
+  import "legacy-timeperiod"
+
+  display_name = "Test 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"
+  }
+}
+