From: Mark Wooding Date: Fri, 22 Jul 2011 18:39:14 +0000 (+0100) Subject: check.d/{disks,ntp}: Only perform the checks if relevant programs exist. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/rcheck/commitdiff_plain/042f27fe47aa2a67e7c99087d8600ce2450c0aa2 check.d/{disks,ntp}: Only perform the checks if relevant programs exist. 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. --- diff --git a/check.d/disks b/check.d/disks index 63a541a..ef36835 100755 --- a/check.d/disks +++ b/check.d/disks @@ -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= diff --git a/check.d/ntp b/check.d/ntp index 68e8ac2..3f95498 100755 --- a/check.d/ntp +++ b/check.d/ntp @@ -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