From 93e8ffaeaa374126ee434be2e61dc1319f12e49c Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 19 Aug 2023 13:23:01 +0200 Subject: [PATCH] Add systemd check, move root disk check to template --- global-templates/commands.conf | 4 ++++ global-templates/host-templates.conf | 4 ++++ global-templates/services.conf | 8 ++++++++ master/hosts.conf | 4 +--- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/global-templates/commands.conf b/global-templates/commands.conf index 3ebd37d..32610d1 100644 --- a/global-templates/commands.conf +++ b/global-templates/commands.conf @@ -103,3 +103,7 @@ object CheckCommand "pgsql_socket" { vars.pgsql_username = "nagios" } + +object CheckCommand "systemd" { + command = [ PluginContribDir + "/check_systemd" ] +} diff --git a/global-templates/host-templates.conf b/global-templates/host-templates.conf index 8de3906..28c4da1 100644 --- a/global-templates/host-templates.conf +++ b/global-templates/host-templates.conf @@ -20,6 +20,10 @@ template Host "linux-host" { import "generic-host" vars.os = "Linux" + + vars.disks["/"] = { + disk_partitions = "/" + } } template Host "debian-host" { diff --git a/global-templates/services.conf b/global-templates/services.conf index b987292..217967a 100644 --- a/global-templates/services.conf +++ b/global-templates/services.conf @@ -150,6 +150,14 @@ apply Service "ssh" { assign where (host.address || host.address6) && host.vars.os == "Linux" && !host.vars.no_check_ssh } +apply Service "systemd" { + import "generic-service" + + check_command = "systemd" + + assign where host.vars.debian_release && host.vars.debian_release >= 12 +} + apply Service "users" { import "generic-service" diff --git a/master/hosts.conf b/master/hosts.conf index d853e7a..ac3d45c 100644 --- a/master/hosts.conf +++ b/master/hosts.conf @@ -9,10 +9,8 @@ object Host "beholder" { address6 = "::1" vars.is_container = false + vars.debian_release = 12 - vars.disks["/"] = { - disk_partitions = "/" - } vars.disks["/boot/efi"] = { disk_partitions = "/boot/efi" }