[project @ peter@palfrader.org-20090303112847-9thng45h9jui32cj]
authorPeter Palfrader <peter@palfrader.org>
Tue, 3 Mar 2009 11:28:47 +0000 (11:28 +0000)
committerPeter Palfrader <peter@palfrader.org>
Tue, 3 Mar 2009 11:28:47 +0000 (11:28 +0000)
run samhain check from cron

dsa-nagios-nrpe-config/debian/cron.d
dsa-nagios-nrpe-config/debian/rules
dsa-nagios-nrpe-config/dsa-update-samhain-status [new file with mode: 0755]

index 01d4be9..6a193f3 100644 (file)
@@ -2,5 +2,6 @@
 @daily   root              [ -x /usr/share/dsa/weak-ssh-keys-check ] && /usr/share/dsa/weak-ssh-keys-check -s /var/cache/dsa/nagios/weak-ssh-keys
 
 @hourly  root [ -x /usr/sbin/dsa-update-apt-status ] && /usr/sbin/dsa-update-apt-status
+13 */4 * * * root [ -x /usr/sbin/dsa-update-apt-samhain ] && /usr/sbin/dsa-update-apt-samhain
 
 # vim:ft=crontab:
index cba02b7..f992dbc 100755 (executable)
@@ -38,6 +38,7 @@ install:
        install -m 755 weak-ssh-keys-check $(CURDIR)/debian/dsa-nagios-nrpe-config/usr/share/dsa
 
        install -m 755 dsa-update-apt-status $(CURDIR)/debian/dsa-nagios-nrpe-config/usr/sbin
+       install -m 755 dsa-update-samhain-status $(CURDIR)/debian/dsa-nagios-nrpe-config/usr/sbin
 
 
 binary-indep: install
diff --git a/dsa-nagios-nrpe-config/dsa-update-samhain-status b/dsa-nagios-nrpe-config/dsa-update-samhain-status
new file mode 100755 (executable)
index 0000000..22bd1dc
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+STATUS=/var/cache/dsa/nagios/samhain
+
+tmp=`tempfile`
+trap "rm -f '$tmp'" exit
+/usr/lib/nagios/plugins/dsa-check-samhain -t 1800 > "$tmp"
+result="$?"
+case "$result" in
+  0)
+       st="OK"
+       ;;
+  1)
+       st="WARNING"
+       ;;
+  2)
+       st="CRITICAL"
+       ;;
+  *)
+       st="UNKNOWN"
+       ;;
+esac
+(echo "$st"; cat "$tmp") > "$STATUS"