Browse Source

Install needrestart on all nodes.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
Maximilian Wilhelm 3 years ago
parent
commit
d77bad69c3
3 changed files with 35 additions and 0 deletions
  1. 12 0
      needrestart/init.sls
  2. 22 0
      needrestart/monitoring.conf
  3. 1 0
      top.sls

+ 12 - 0
needrestart/init.sls

@@ -0,0 +1,12 @@
+#
+# Needrestart
+#
+
+needrestart:
+  pkg.installed
+
+/etc/needrestart/conf.d/monitoring.conf:
+  file.managed:
+    - source: salt://needrestart/monitoring.conf
+    - require:
+      - pkg: needrestart

+ 22 - 0
needrestart/monitoring.conf

@@ -0,0 +1,22 @@
+#
+# Icinga plugin related configuration (Salt managed)
+#
+# Nagios Plugin: configure return code use by nagios
+# as service status[1].
+#
+# [1] https://nagios-plugins.org/doc/guidelines.html#AEN78
+#
+# Default:
+#  'nagios-status' => {
+#     'sessions' => 1,
+#     'services' => 2,
+#     'kernel' => 2,
+#     'ucode' => 2,
+#     'containers' => 1
+#  },
+#
+# Example: to ignore outdated sessions (status OK)
+# $nrconf{'nagios-status'}->{sessions} = 0;
+
+# Just warn about newer kernel
+$nrconf{'nagios-status'}->{kernel} = 1;

+ 1 - 0
top.sls

@@ -11,6 +11,7 @@ base:
     - locales
     - mosh
     - motd
+    - needrestart
     - network
     - ntp
     - postfix