summaryrefslogtreecommitdiffstats
path: root/zones.d
diff options
context:
space:
mode:
Diffstat (limited to 'zones.d')
-rw-r--r--zones.d/global-templates/commands.conf23
-rw-r--r--zones.d/global-templates/services.conf8
2 files changed, 31 insertions, 0 deletions
diff --git a/zones.d/global-templates/commands.conf b/zones.d/global-templates/commands.conf
index 1fe8b56..22d7c8b 100644
--- a/zones.d/global-templates/commands.conf
+++ b/zones.d/global-templates/commands.conf
@@ -1,3 +1,26 @@
object CheckCommand "systemd" {
command = [ PluginDir + "/check_systemd" ]
}
+
+object CheckCommand "needrestart" {
+ command = [ "/usr/bin/sudo", "/usr/sbin/needrestart", "-p" ]
+
+ arguments = {
+ "-v" = {
+ set_if = "$needrestart_verbose$"
+ description = "Show details for debugging"
+ }
+ "-k" = {
+ set_if = "$needrestart_limit_kernel$"
+ description = "Limit to checking for obsolete kernel"
+ }
+ "-l" = {
+ set_if = "$needrestart_limit_libraries$"
+ description = "Limit to checking for obsolete libraries"
+ }
+ }
+
+ vars.needrestart_verbose = false
+ vars.needrestart_limit_kernel = false
+ vars.needrestart_limit_libraries = false
+}
diff --git a/zones.d/global-templates/services.conf b/zones.d/global-templates/services.conf
index 23c2a91..2b33cbe 100644
--- a/zones.d/global-templates/services.conf
+++ b/zones.d/global-templates/services.conf
@@ -55,6 +55,14 @@ apply Service "systemd" {
assign where host.vars.init == "systemd"
}
+apply Service "needrestart" {
+ import "generic-service"
+
+ check_command = "needrestart"
+
+ assign where host.vars.kernel == "linux"
+}
+
/* OS specific basic health checks */
apply Service "apt" {
import "generic-service"