From: Frank Brehm Date: Fri, 5 Jan 2018 12:42:21 +0000 (+0100) Subject: saving uncommitted changes in /etc prior to apt run X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=92c7838cd5cce3306854bf27da2a2eb0b6d22fc2;p=config%2Fns1%2Fetc.git saving uncommitted changes in /etc prior to apt run --- diff --git a/icinga2/conf.d/ns1.conf b/icinga2/conf.d/ns1.conf index 4cb562d..c79c9b1 100644 --- a/icinga2/conf.d/ns1.conf +++ b/icinga2/conf.d/ns1.conf @@ -14,6 +14,8 @@ object Host "ns1.uhu-banane.de" { vars.is_ns = true vars.check_dns_domain = "uhu-banane.de" + vars.is_mail_sattelite = true + /* Define http vhost attributes for service apply rules in `services.conf`. */ vars.http_vhosts["http"] = { http_uri = "/" diff --git a/icinga2/conf.d/services/dns.conf b/icinga2/conf.d/services/dns.conf index f28638d..01d4e0c 100644 --- a/icinga2/conf.d/services/dns.conf +++ b/icinga2/conf.d/services/dns.conf @@ -1,7 +1,11 @@ apply Service "proc named" { import "generic-service" - #host_name = "ns1.uhu-banane.de" + + if ( host.vars.client_endpoint ) { + // specify where the check is executed + command_endpoint = host.vars.client_endpoint + } check_command = "procs" vars.procs_argument = "/usr/sbin/named" diff --git a/icinga2/zones.d/master/hosts.conf b/icinga2/zones.d/master/hosts.conf index 3317802..f552d8d 100644 --- a/icinga2/zones.d/master/hosts.conf +++ b/icinga2/zones.d/master/hosts.conf @@ -13,6 +13,8 @@ object Host "ns2.uhu-banane.de" { http_uri = "/" } + vars.is_mail_sattelite = true + vars.ping_wrta = 200 vars.ping_crta = 300 @@ -51,6 +53,13 @@ object Host "ns3.uhu-banane.de" { vars.is_ns = true vars.check_dns_domain = "uhu-banane.de" + vars.is_mail_sattelite = true + vars.is_mta = true + + vars.mailq_warning = 3 + vars.mailq_critical = 10 + + /* Define http vhost attributes for service apply rules in `services.conf`. */ vars.http_vhosts["http"] = { http_uri = "/" diff --git a/icinga2/zones.d/master/services.conf b/icinga2/zones.d/master/services.conf index e234040..636e5ff 100644 --- a/icinga2/zones.d/master/services.conf +++ b/icinga2/zones.d/master/services.conf @@ -84,16 +84,55 @@ apply Service "mailq" { check_command = "mailq" - //specify where the check is executed - command_endpoint = host.vars.client_endpoint + if ( host.vars.client_endpoint ) { + // specify where the check is executed + command_endpoint = host.vars.client_endpoint + } + + vars.mailq_warning = 100 + vars.mailq_critical = 300 + + assign where host.vars.is_mta && ! host.vars.is_mail_sattelite +} + +apply Service "mailq" { + import "generic-service" + + check_command = "mailq" + + if ( host.vars.client_endpoint ) { + // specify where the check is executed + command_endpoint = host.vars.client_endpoint + } + + vars.mailq_warning = 3 + vars.mailq_critical = 10 + + assign where host.vars.is_mail_sattelite +} + +apply Service "proc postfix" { + import "generic-service" + + if ( host.vars.client_endpoint ) { + // specify where the check is executed + command_endpoint = host.vars.client_endpoint + } + + check_command = "procs" + vars.procs_argument = "/usr/lib/postfix/sbin/master" + vars.procs_ppid = 1 + vars.procs_warning = "1:1" + vars.procs_critical = "1:2" + vars.procs_user = "root" - assign where host.vars.client_endpoint && host.vars.is_mta + assign where host.vars.is_mta || host.vars.is_mail_sattelite } apply Service "smtp" { import "generic-service" check_command = "smtp" - assign where host.vars.is_mta + assign where host.vars.is_mta && ! host.vars.is_mail_sattelite } apply Service "imap" {