X-Git-Url: https://arthur.barton.de/gitweb/?p=nagcollect.git;a=blobdiff_plain;f=client%2Flib%2Ftests%2FDarwin%2FDiskErrors.tst;fp=client%2Flib%2Ftests%2FDarwin%2FDiskErrors.tst;h=40df3602fc3cf8f33cd6a4b47a8f8a9036cb2f59;hp=2556581164760f4d5d733eeef94a09435698c3fb;hb=bfe39e81e611374fa2b72ac50824e88bb7e2abc3;hpb=a789ea0f47bd04268c975cc9582c353ebc16d690 diff --git a/client/lib/tests/Darwin/DiskErrors.tst b/client/lib/tests/Darwin/DiskErrors.tst index 2556581..40df360 100644 --- a/client/lib/tests/Darwin/DiskErrors.tst +++ b/client/lib/tests/Darwin/DiskErrors.tst @@ -5,22 +5,25 @@ SERVICE="Disks_p" +grepcmd='grep -i "I/O" | grep -i error | grep -v nagcollect + | grep -v "com.apple.mdworker.pool" + | grep -v "file i/o error - bad dset location" + | grep -v "encoder error" +' + offset=`LC_ALL=C grep -b "BOOT_TIME:" /var/log/system.log \ | tail -n 1 | cut -d':' -f1` [ -n "$offset" ] || offset=`LC_ALL=C grep -b -- --NagiosReset-- \ /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 \ - | grep -v "com.apple.mdworker.pool" \ - | grep -v "file i/o error - bad dset location" \ - | grep -v "encoder error" \ - | tail -n 1` + | eval $grepcmd | 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` + | eval $grepcmd | tail -n 1` fi if [ -n "$error" ]; then msg=`echo $error | cut -d' ' -f6-`