From fe891ee886bd6c57f7297b13f5fe03cae3a481d2 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Tue, 15 Aug 2023 17:57:42 +0200 Subject: [PATCH] Fix service assignments --- global-templates/hostgroups.conf | 4 ++++ global-templates/services.conf | 8 ++++---- master/hosts.conf | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 global-templates/hostgroups.conf diff --git a/global-templates/hostgroups.conf b/global-templates/hostgroups.conf new file mode 100644 index 0000000..c5a9be5 --- /dev/null +++ b/global-templates/hostgroups.conf @@ -0,0 +1,4 @@ +// vim: set ft=icinga2 et sw=2 ts=2 si ai: +object HostGroup "monitoring" { + display_name = "Monitoring Servers" +} diff --git a/global-templates/services.conf b/global-templates/services.conf index df9be2d..f8f19bb 100644 --- a/global-templates/services.conf +++ b/global-templates/services.conf @@ -17,7 +17,7 @@ apply Service "icinga" { check_command = "icinga" - assign where "generic-host" in host.groups + assign where true } apply Service "procs" { @@ -25,7 +25,7 @@ apply Service "procs" { check_command = "procs" - assign where "generic-host" in host.groups + assign where true } apply Service "proc-" for (proc => config in host.vars.procs) { @@ -35,7 +35,7 @@ apply Service "proc-" for (proc => config in host.vars.procs) { vars += config - assign where "procs" in host.vars + assign where host.vars.disks } apply Service "disk-" for (disk => config in host.vars.disks) { @@ -45,5 +45,5 @@ apply Service "disk-" for (disk => config in host.vars.disks) { vars += config - assign where "disks" in host.vars + assign where host.vars.disks } diff --git a/master/hosts.conf b/master/hosts.conf index e044119..4014589 100644 --- a/master/hosts.conf +++ b/master/hosts.conf @@ -2,6 +2,8 @@ object Host "beholder" { import "debian-host" + groups += [ "monitoring" ] + address = "127.0.0.1" address6 = "::1"