diff --git a/playbooks/icinga2.yml b/playbooks/icinga2.yml index 471a6df..fce54fe 100644 --- a/playbooks/icinga2.yml +++ b/playbooks/icinga2.yml @@ -13,6 +13,7 @@ - monitoring-plugins-basic - monitoring-plugins-common - monitoring-plugins-standard + - monitoring-plugins-systemd state: present - name: Setup Icinga2 master diff --git a/roles/icinga2_master/templates/zones.d/global-templates/commands.conf.j2 b/roles/icinga2_master/templates/zones.d/global-templates/commands.conf.j2 index 23682be..d621370 100644 --- a/roles/icinga2_master/templates/zones.d/global-templates/commands.conf.j2 +++ b/roles/icinga2_master/templates/zones.d/global-templates/commands.conf.j2 @@ -4,3 +4,9 @@ object CheckCommand "sudo_pgsql" { import "pgsql" command = [ "sudo", "-u", "postgres" ] + command } + +# the original "systemd" CheckCommand uses /check_systemd.py as executable +object CheckCommand "check_systemd" { + import "systemd" + command = [ PluginDir + "/check_systemd" ] +} diff --git a/roles/icinga2_master/templates/zones.d/master/services/common.conf.j2 b/roles/icinga2_master/templates/zones.d/master/services/common.conf.j2 index dccdc0e..51398ab 100644 --- a/roles/icinga2_master/templates/zones.d/master/services/common.conf.j2 +++ b/roles/icinga2_master/templates/zones.d/master/services/common.conf.j2 @@ -88,3 +88,10 @@ apply Service "mailq" { vars.mailq_warning = 10 vars.mailq_critical = 20 } + +apply Service "systemd" { + import "generic-service" + check_command = "check_systemd" + command_endpoint = host.name + assign where true +}