From f32e066ac96a6e2d31d9ff1c2c2023585d03bb23 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sun, 12 Dec 2010 12:03:00 -0800 Subject: [PATCH] Update binary search logic to look in PATH as a fallback The vos binary is installed in sbin by the Red Hat packages and the default upstream installation rules, so check in sbin as well as bin. Patch from Daniel Scott. Also fall back, for all AFS binaries, to using PATH if the binary can't be found in known locations. Also checks for vos in /usr/local/sbin/vos. --- NEWS | 7 +++++++ check_afs_bos | 2 +- check_afs_quotas | 5 +++-- check_afs_rxdebug | 2 +- check_afs_space | 5 +++-- check_afs_udebug | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 48073dc..6cf926a 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ User-Visible afs-monitor Changes +afs-monitor 2.2 (unreleased) + + The vos binary is installed in sbin by the Red Hat packages and the + default upstream installation rules, so check in sbin as well as bin. + Patch from Daniel Scott. Also fall back, for all AFS binaries, to + using PATH if the binary can't be found in known locations. + afs-monitor 2.1 (2010-12-08) Fix a bug in check_afs_space introduced in the previous release with diff --git a/check_afs_bos b/check_afs_bos index 43be08c..b3ff46c 100755 --- a/check_afs_bos +++ b/check_afs_bos @@ -33,7 +33,7 @@ use Getopt::Long qw(GetOptions); # The full path to bos. Make sure that this is on local disk so that # monitoring doesn't have an AFS dependency. our ($BOS) = grep { -x $_ } qw(/usr/bin/bos /usr/local/bin/bos); -$BOS ||= '/usr/bin/bos'; +$BOS ||= 'bos'; # The default timeout in seconds (implemented by alarm) for rxdebug. our $TIMEOUT = 10; diff --git a/check_afs_quotas b/check_afs_quotas index 6d63039..4c9d630 100755 --- a/check_afs_quotas +++ b/check_afs_quotas @@ -50,8 +50,9 @@ our $TIMEOUT = 300; # The full path to vos. Make sure that this is on local disk so that # monitoring doesn't have an AFS dependency. -our ($VOS) = grep { -x $_ } qw(/usr/bin/vos /usr/local/bin/vos /usr/sbin/vos); -$VOS ||= '/usr/bin/vos'; +our ($VOS) = grep { -x $_ } + qw(/usr/bin/vos /usr/sbin/vos /usr/local/bin/vos /usr/local/sbin/vos); +$VOS ||= 'vos'; ############################################################################## # AFS operations diff --git a/check_afs_rxdebug b/check_afs_rxdebug index 6f55b4b..a436d4c 100755 --- a/check_afs_rxdebug +++ b/check_afs_rxdebug @@ -44,7 +44,7 @@ our $TIMEOUT = 60; our ($RXDEBUG) = grep { -x $_ } qw(/usr/bin/rxdebug /usr/sbin/rxdebug /usr/local/bin/rxdebug /usr/local/sbin/rxdebug); -$RXDEBUG ||= '/usr/bin/rxdebug'; +$RXDEBUG ||= 'rxdebug'; ############################################################################## # Implementation diff --git a/check_afs_space b/check_afs_space index 495d53b..7dd2da9 100755 --- a/check_afs_space +++ b/check_afs_space @@ -49,8 +49,9 @@ our $TIMEOUT = 300; # The full path to vos. Make sure that this is on local disk so that # monitoring doesn't have an AFS dependency. -our ($VOS) = grep { -x $_ } qw(/usr/bin/vos /usr/local/bin/vos /usr/sbin/vos); -$VOS ||= '/usr/bin/vos'; +our ($VOS) = grep { -x $_ } + qw(/usr/bin/vos /usr/sbin/vos /usr/local/bin/vos /usr/local/sbin/vos); +$VOS ||= 'vos'; ############################################################################## # Implementation diff --git a/check_afs_udebug b/check_afs_udebug index a48ba76..6232901 100755 --- a/check_afs_udebug +++ b/check_afs_udebug @@ -34,7 +34,7 @@ our $TIMEOUT = 10; # The full path to udebug. Make sure that this is on local disk so that # monitoring doesn't have an AFS dependency. our ($UDEBUG) = grep { -x $_ } qw(/usr/bin/udebug /usr/local/bin/udebug); -$UDEBUG ||= '/usr/bin/udebug'; +$UDEBUG ||= 'udebug'; ############################################################################## # Implementation -- 2.39.5