]> Frank Brehm's Git Trees - config/ns1/etc.git/commitdiff
daily autocommit
authorFrank Brehm <frank@brehm-online.com>
Fri, 13 Oct 2017 04:39:56 +0000 (06:39 +0200)
committerFrank Brehm <frank@brehm-online.com>
Fri, 13 Oct 2017 04:39:56 +0000 (06:39 +0200)
.etckeeper
icinga2/conf.d/services.conf
icinga2/icinga2.conf
icinga2/zones.conf
icinga2/zones.d/master/hosts.conf [new file with mode: 0644]
icinga2/zones.d/master/services.conf [new file with mode: 0644]

index 225736c17396bdd2648578884146ede96becc52d..c88046c92645cf0dc86632c144bd8b455c3e08e1 100755 (executable)
@@ -871,6 +871,9 @@ maybe chmod 0644 'icinga2/zones.conf'
 maybe chmod 0644 'icinga2/zones.conf.orig'
 maybe chmod 0755 'icinga2/zones.d'
 maybe chmod 0644 'icinga2/zones.d/README'
+maybe chmod 0755 'icinga2/zones.d/master'
+maybe chmod 0644 'icinga2/zones.d/master/hosts.conf'
+maybe chmod 0644 'icinga2/zones.d/master/services.conf'
 maybe chmod 0755 'init'
 maybe chmod 0755 'init.d'
 maybe chmod 0644 'init.d/README'
index 312b11e1673341a9931096297bee04bfed3f75db..fb634b5c879b4123604e7dcc49ae089f40de64de 100644 (file)
@@ -68,6 +68,8 @@ apply Service for (disk => config in host.vars.disks) {
   check_command = "disk"
 
   vars += config
+
+  assign where ! host.vars.client_endpoint
 }
 
 
index 019072f98f5eb23367a54f349be31a1711b97b76..a809b96949804586f2311e23277ee802a9d3b532 100644 (file)
@@ -60,4 +60,4 @@ include_recursive "repository.d"
  * the preferred way is to create separate directories and files in the conf.d
  * directory. Each of these files must have the file extension ".conf".
  */
-#include_recursive "conf.d"
+include_recursive "conf.d"
index 480d09137af43337ccf8d351e10d63eb068fb799..22600feff8f12a66c8b702a6817a490efe3df3cc 100644 (file)
@@ -5,8 +5,6 @@
 
 
 object Endpoint "ns1.uhu-banane.de" {
-        host = "ns1.uhu-banane.de"
-        port = "5665"
 }
 
 object Zone "master" {
@@ -23,8 +21,13 @@ object Endpoint "sarah.uhu-banane.de" {
         port = "5665"
 }
 
-object Zone "icinga_clients_de" {
-        endpoints = [ "ns3.uhu-banane.de", "sarah.uhu-banane.de" ]
+object Zone "ns3.uhu-banane.de" {
+        endpoints = [ "ns3.uhu-banane.de" ]
+        parent = "master"
+}
+
+object Zone "sarah.uhu-banane.de" {
+        endpoints = [ "sarah.uhu-banane.de" ]
         parent = "master"
 }
 
diff --git a/icinga2/zones.d/master/hosts.conf b/icinga2/zones.d/master/hosts.conf
new file mode 100644 (file)
index 0000000..87bc34c
--- /dev/null
@@ -0,0 +1,40 @@
+object Host "ns3.uhu-banane.de" {
+  check_command = "hostalive" //check is executed on the master
+  address = "185.102.95.107"
+
+  vars.os = "Linux"
+  vars.os_family = "Debian"
+  # All about DNS server
+  vars.is_ns = true
+  vars.check_dns_domain = "uhu-banane.de"
+
+  /* Define http vhost attributes for service apply rules in `services.conf`. */
+  vars.http_vhosts["http"] = {
+    http_uri = "/"
+  }
+
+  /* Define disks and attributes for service apply rules in `services.conf`. */
+  vars.disks["disk"] = {
+    /* No parameters. */
+  }
+  vars.disks["disk /"] = {
+    disk_partitions = "/"
+  }
+  vars.disks["disk /home"] = {
+    disk_partitions = "/home"
+  }
+  vars.disks["disk /tmp"] = {
+    disk_partitions = "/tmp"
+  }
+  vars.disks["disk /var"] = {
+    disk_partitions = "/var"
+  }
+
+  /* Define notification mail attributes for notification apply rules in `notifications.conf`. */
+  vars.notification["mail"] = {
+    /* The UserGroup `icingaadmins` is defined in `users.conf`. */
+    groups = [ "icingaadmins" ]
+  }
+  vars.client_endpoint = name //follows the convention that host name == endpoint name
+}
+
diff --git a/icinga2/zones.d/master/services.conf b/icinga2/zones.d/master/services.conf
new file mode 100644 (file)
index 0000000..07d4bcd
--- /dev/null
@@ -0,0 +1,81 @@
+
+#apply Service "ping4" {
+#  check_command = "ping4"
+#  //check is executed on the master node
+#  assign where host.address
+#}
+
+apply Service for (disk => config in host.vars.disks) {
+  import "generic-service"
+  check_command = "disk"
+
+  vars += config
+
+  //specify where the check is executed
+  command_endpoint = host.vars.client_endpoint
+
+  assign where host.vars.client_endpoint
+}
+
+apply Service "apt" {
+  import "generic-service"
+
+  check_command = "apt"
+  enable_notifications = false
+
+  //specify where the check is executed
+  command_endpoint = host.vars.client_endpoint
+
+  assign where host.vars.client_endpoint && host.vars.os_family == "Debian"
+
+}
+
+apply Service "load" {
+  import "generic-service"
+
+  check_command = "load"
+
+  /* Used by the ScheduledDowntime apply rule in `downtimes.conf`. */
+  vars.backup_downtime = "02:00-03:00"
+
+  //specify where the check is executed
+  command_endpoint = host.vars.client_endpoint
+
+  assign where host.vars.client_endpoint
+
+}
+
+apply Service "procs" {
+  import "generic-service"
+
+  check_command = "procs"
+
+  //specify where the check is executed
+  command_endpoint = host.vars.client_endpoint
+
+  assign where host.vars.client_endpoint
+
+}
+
+apply Service "swap" {
+  import "generic-service"
+
+  check_command = "swap"
+
+  //specify where the check is executed
+  command_endpoint = host.vars.client_endpoint
+
+  assign where host.vars.client_endpoint
+}
+
+apply Service "users" {
+  import "generic-service"
+
+  check_command = "users"
+
+  //specify where the check is executed
+  command_endpoint = host.vars.client_endpoint
+
+  assign where host.vars.client_endpoint
+}
+