]> granicus.if.org Git - icinga2/commitdiff
Config: add more example config for an icinga2 localhost (fixes #3256)
authorMichael Friedrich <michael.friedrich@gmail.com>
Sun, 7 Oct 2012 22:21:56 +0000 (00:21 +0200)
committerMichael Friedrich <michael.friedrich@gmail.com>
Sun, 7 Oct 2012 22:21:56 +0000 (00:21 +0200)
icinga-app/config/icinga2.conf.dist

index 7eb7da899e63515620e8433410eca8d807489818..5c67b8298bbcc23a626e7d911af2a46f745b7904 100644 (file)
@@ -97,3 +97,103 @@ object Host "localhost" {
   check_interval = 1m
 }
 
+
+
+/**
+ * Below, an advanced example of checking a host and its services
+ */
+
+/*
+ * ping
+ */
+abstract object Service "ping4" inherits "icinga-service" {
+  check_command = "$plugindir$/check_ping -H $address$ -w $wrta$,$wpl$% -c $crta$,$cpl$%",
+  macros += {
+    wrta = 50,
+    wpl = 5,
+    crta = 100,
+    cpl = 10
+  }
+}
+
+abstract object Service "ping6" inherits "icinga-service" {
+  check_command = "$plugindir$/check_ping -6 -H $address6$ -w $wrta$,$wpl$% -c $crta$,$cpl$%",
+  macros += {
+    wrta = 50,
+    wpl = 5,
+    crta = 100,
+    cpl = 10
+  }
+}
+
+/*
+ * http
+ */
+abstract object Service "http" inherits "icinga-service" {
+  check_command = "$plugindir$/check_http -H '$address$' -I '$address$'",
+}
+
+/*
+ * ssh
+ */
+abstract object Service "ssh" inherits "icinga-service" {
+  check_command = "$plugindir$/check_ssh '$address$'",
+}
+
+/*
+ * local checks
+ */
+abstract object Service "disk space" inherits "icinga-service" {
+  check_command = "$plugindir$/check_disk -w '$wfree$' -c '$cfree$'",
+  macros += {
+    wfree = "20%",
+    cfree = "10%",
+  }
+}
+
+abstract object Service "current users" inherits "icinga-service" {
+  check_command = "$plugindir$/check_users -w '$wgreater$' -c '$cgreater$'",
+  macros += {
+    wgreater = 20,
+    cgreater = 50,
+  }
+}
+
+abstract object Service "total processes" inherits "icinga-service" {
+  check_command = "$plugindir$/check_procs -w '$wgreater$' -c '$cgreater$'",
+  macros += {
+    wgreater = 250,
+    cgreater = 400,
+  }
+}
+
+abstract object Service "current load" inherits "icinga-service" {
+  check_command = "$plugindir$/check_load --warning='$wload1$,$wload5$,$wload15$' --critical='$cload1$,$cload5$,$cload15$'",
+  macros += {
+    wload1 = 5.0,
+    wload5 = 4.0,
+    wload15 = 3.0,
+    cload1 = 10.0,
+    cload5 = 6.0,
+    cload15 = 4.0,
+  }
+}
+
+
+/*
+ * one advanced icinga2 localhost
+ */
+object Host "localhost-i2" {
+  services = {
+    "ping", "ping6",
+    "http", "ssh",
+    "current load", "total processes",
+    "current users", "disk space",
+  },
+  macros = {
+    address = "127.0.0.1",
+    address6 = "::1",
+  },
+  check_interval = 1m
+}
+