]> arthur.barton.de Git - nagcollect.git/commitdiff
New "Disks" test to check for I/O errors on for Mac OS X
authorAlexander Barton <alex@barton.de>
Mon, 14 Dec 2009 12:24:52 +0000 (13:24 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 14 Dec 2009 12:24:52 +0000 (13:24 +0100)
client/lib/tests/Disks.tst [new file with mode: 0644]

diff --git a/client/lib/tests/Disks.tst b/client/lib/tests/Disks.tst
new file mode 100644 (file)
index 0000000..0c0451c
--- /dev/null
@@ -0,0 +1,15 @@
+# NagCollect -- Nagios Data Collector for Passive Checks
+# Copyright (c)2009 Alexander Barton, alex@barton.de
+
+if [ `uname` = "Darwin" ]; then
+       SERVICE="Disks_p"
+       error=`LC_ALL=C grep "I/O" /var/log/system.log | tail -n 1`
+       if [ -n "$error" ]; then
+               msg=`echo $error | cut -d' ' -f6-`
+               STATUS=2
+               TEXT="ERROR - $msg"
+       else
+               STATUS=0
+               TEXT="OK - No I/O errors detected."
+       fi
+fi