X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=client%2Flib%2Ftests%2FDisks.tst;h=d0816084fdf5ef7bfd0006d200e7c9da39d5a9fc;hb=9d40adf76c79dcfc43346d1b8241fb2193a6f981;hp=297aae2765cf06fe7a81d2c467ddc8d4766002c8;hpb=56049a4b67af4dead605f9cb7e244f423302b95e;p=nagcollect.git diff --git a/client/lib/tests/Disks.tst b/client/lib/tests/Disks.tst index 297aae2..d081608 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 | grep -v nagcollect | 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/O" | grep -v nagcollect | tail -n 1` + else + # no reboot detected in system.log + error=`LC_ALL=C grep "I/O" /var/log/system.log \ + | grep -v nagcollect | tail -n 1` + fi if [ -n "$error" ]; then msg=`echo $error | cut -d' ' -f6-` STATUS=2