]> arthur.barton.de Git - nagcollect.git/blobdiff - client/lib/tests/Darwin/DiskErrors.tst
DiskErrors.tst: exclude false positive I/O error of mdworker
[nagcollect.git] / client / lib / tests / Darwin / DiskErrors.tst
index e2d2ce990713f90b5be75c55e1c05ba14eb5a2bb..67075f42c44e0f1374694ffd8ae978a94ab007be 100644 (file)
@@ -1,5 +1,5 @@
 # NagCollect -- Nagios Data Collector for Passive Checks
-# Copyright (c)2010 Alexander Barton, alex@barton.de
+# Copyright (c)2010-2011 Alexander Barton, alex@barton.de
 
 # Check disks for I/O errors
 
@@ -7,10 +7,13 @@ SERVICE="Disks_p"
 
 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 | tail -n 1`
+        | grep -i "I/O" | grep -i error | grep -v nagcollect \
+        | grep -v "com.apple.mdworker.pool" | tail -n 1`
 else
        # no reboot detected in system.log
        error=`LC_ALL=C grep -i "I/O" /var/log/system.log \