From: Peter Palfrader Date: Tue, 3 Mar 2009 11:28:47 +0000 (+0000) Subject: [project @ peter@palfrader.org-20090303112847-9thng45h9jui32cj] X-Git-Url: https://wiki.adam-barratt.org.uk/gitweb/?a=commitdiff_plain;h=836aa8da019b59784544e577336a686c8291824f;p=mirror%2Fdsa-nagios.git [project @ peter@palfrader.org-20090303112847-9thng45h9jui32cj] run samhain check from cron --- diff --git a/dsa-nagios-nrpe-config/debian/cron.d b/dsa-nagios-nrpe-config/debian/cron.d index 01d4be9..6a193f3 100644 --- a/dsa-nagios-nrpe-config/debian/cron.d +++ b/dsa-nagios-nrpe-config/debian/cron.d @@ -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: diff --git a/dsa-nagios-nrpe-config/debian/rules b/dsa-nagios-nrpe-config/debian/rules index cba02b7..f992dbc 100755 --- a/dsa-nagios-nrpe-config/debian/rules +++ b/dsa-nagios-nrpe-config/debian/rules @@ -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 index 0000000..22bd1dc --- /dev/null +++ b/dsa-nagios-nrpe-config/dsa-update-samhain-status @@ -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"