X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-nrpe-config%2Fdsa-update-apt-status;h=3e3acefbb627d3839494b1ffe7c54d1a061185d7;hb=836aa8da019b59784544e577336a686c8291824f;hp=a6b5b8ada8b92fde1b2e7334bb71cdc61e9eb539;hpb=6f1b9549915d9d7837e09a3a53054237801b573d;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-nrpe-config/dsa-update-apt-status b/dsa-nagios-nrpe-config/dsa-update-apt-status index a6b5b8a..3e3acef 100755 --- a/dsa-nagios-nrpe-config/dsa-update-apt-status +++ b/dsa-nagios-nrpe-config/dsa-update-apt-status @@ -23,7 +23,7 @@ run_required() { local last_mod last_mod=`stat -c "%Y" "$STATUS"` now=`date +%s` - age=$(( "$now" - "$last_mod" )) + age=$(( $now - $last_mod )) [ "$age" -gt "$MAX_AGE" ] && return $run return $norun @@ -40,7 +40,7 @@ fi # run apt-get update, retry a few times if it fails count=0 while [ "$count" -lt "$UPDATE_RUNS" ]; do - apt-get update -qq + apt-get update -qq >/dev/null >&2 if [ "$?" = "0" ]; then break; fi sleep $(( $RANDOM % 600 )) count="$(( $count + 1 ))" @@ -54,7 +54,8 @@ fi # run the apt check itself tmp=`tempfile` trap "rm -f '$tmp'" exit -/usr/share/dsa/apt-status-check --noupdate --timeout=600 > "$tmp" +#/usr/share/dsa/apt-status-check --noupdate --timeout=600 > "$tmp" +/usr/lib/nagios/plugins/dsa-check-packages > "$tmp" result="$?" case "$result" in 0)