X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=client%2Flib%2Ftests%2FDisks.tst;h=9c7b0459dbe15a2a14e5b2c5cf6f9200509ff53f;hb=8f1a22e4afc931ae86a4661f0d4e0037e4b2073f;hp=0c0451cb2e5be1614b538b9ed1b593266592692b;hpb=be3abf344192576818a4e200bd937ab08e410d2b;p=nagcollect.git diff --git a/client/lib/tests/Disks.tst b/client/lib/tests/Disks.tst index 0c0451c..9c7b045 100644 --- a/client/lib/tests/Disks.tst +++ b/client/lib/tests/Disks.tst @@ -3,7 +3,17 @@ if [ `uname` = "Darwin" ]; then SERVICE="Disks_p" - error=`LC_ALL=C grep "I/O" /var/log/system.log | tail -n 1` + offset=`LC_ALL=C grep -b "BOOT_TIME:" /var/log/system.log \ + | tail -n 1 | cut -d':' -f1` + if [ -n "$offset" ]; then + # reboot detected in system.log + error=`LC_ALL=C tail -c "+$offset" /var/log/system.log \ + | grep -i "I/O" | grep -i error | grep -v nagcollect | tail -n 1` + else + # no reboot detected in system.log + error=`LC_ALL=C grep -i "I/O" /var/log/system.log \ + | grep -i error | grep -v nagcollect | tail -n 1` + fi if [ -n "$error" ]; then msg=`echo $error | cut -d' ' -f6-` STATUS=2