From: Frank Brehm Date: Fri, 13 Oct 2017 04:39:56 +0000 (+0200) Subject: daily autocommit X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=c8b88bccc42782086295d06f733e437a0b53349e;p=config%2Fns1%2Fetc.git daily autocommit --- diff --git a/.etckeeper b/.etckeeper index 225736c..c88046c 100755 --- a/.etckeeper +++ b/.etckeeper @@ -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' diff --git a/icinga2/conf.d/services.conf b/icinga2/conf.d/services.conf index 312b11e..fb634b5 100644 --- a/icinga2/conf.d/services.conf +++ b/icinga2/conf.d/services.conf @@ -68,6 +68,8 @@ apply Service for (disk => config in host.vars.disks) { check_command = "disk" vars += config + + assign where ! host.vars.client_endpoint } diff --git a/icinga2/icinga2.conf b/icinga2/icinga2.conf index 019072f..a809b96 100644 --- a/icinga2/icinga2.conf +++ b/icinga2/icinga2.conf @@ -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" diff --git a/icinga2/zones.conf b/icinga2/zones.conf index 480d091..22600fe 100644 --- a/icinga2/zones.conf +++ b/icinga2/zones.conf @@ -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 index 0000000..87bc34c --- /dev/null +++ b/icinga2/zones.d/master/hosts.conf @@ -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 index 0000000..07d4bcd --- /dev/null +++ b/icinga2/zones.d/master/services.conf @@ -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 +} +