check.d/{disks,ntp}: Only perform the checks if relevant programs exist.
authorMark Wooding <mwooding@ncipher.com>
Fri, 22 Jul 2011 18:39:14 +0000 (19:39 +0100)
committerMark Wooding <mwooding@ncipher.com>
Fri, 22 Jul 2011 18:41:36 +0000 (19:41 +0100)
If smartctl(8) isn't installed, then presumably we don't need to check
the status of disks; and if there's no ntpd(8) it's pointless checking
synchronization.

check.d/disks
check.d/ntp

index 63a541a..ef36835 100755 (executable)
@@ -3,6 +3,7 @@
 ### Check the health of attached physical disks.
 
 set -e
+if [ ! -x /usr/sbin/smartctl ]; then exit 0; fi
 
 ## Build a list of actual disk devices according to their buses.
 disks=
index 68e8ac2..3f95498 100755 (executable)
@@ -1,5 +1,7 @@
 #! /bin/sh -e
 
+if [ ! -x /usr/sbin/ntpc ]; then exit 0; fi
+
 ntpdc -c peers | {
   any=nil
   while read remote local st poll reach delay offset disp; do