mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Merge branch 'fix-autoconf-exitcode'
Various plugins still followed the old (before 2009?) convention of using a non-zero exitcode for indicating "no". Most of these (obvious) occasions should be fixed now.
This commit is contained in:
commit
272220c61a
197 changed files with 380 additions and 588 deletions
|
@ -77,11 +77,11 @@ EOF
|
|||
|
||||
do_autoconf () {
|
||||
case $WLERR in
|
||||
0) echo yes; exit 0;;
|
||||
127) echo "no ($AL)"; exit 1;;
|
||||
*) echo "no (wl error: $AL)"; exit 1;;
|
||||
*) echo "no (no wl executable, or error)"; exit 1;;
|
||||
0) echo yes;;
|
||||
127) echo "no ($AL)";;
|
||||
*) echo "no (wl error: $AL)";;
|
||||
esac
|
||||
exit 0
|
||||
}
|
||||
|
||||
case $1 in
|
||||
|
|
|
@ -19,11 +19,10 @@ LOG=/etc/hosts.deny
|
|||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -r "$LOG" ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
|
|
@ -93,11 +93,10 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) {
|
|||
if (! -s $resconf) { $ret .= "$resconf not found. "; }
|
||||
if ($ret) {
|
||||
print "no ($ret)\n";
|
||||
exit 1;
|
||||
} else {
|
||||
print "yes\n";
|
||||
exit 0;
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ( defined $ARGV[0] and $ARGV[0] eq "suggest" ) {
|
||||
|
|
|
@ -42,11 +42,10 @@ if [ "$1" = "autoconf" ]; then
|
|||
$ETHTOOL 2>/dev/null >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo no
|
||||
exit 1
|
||||
else
|
||||
echo yes
|
||||
exit 0
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
|
|
@ -272,11 +272,10 @@ if ( !( ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) or
|
|||
if ( defined($ARGV[0]) and $ARGV[0] eq "autoconf" ) {
|
||||
if ( ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) or ( $usenetstat eq "no" and defined($adminhost) and defined($adminport) and defined($adminusername) and defined($adminpassword) ) ) {
|
||||
print("yes\n");
|
||||
exit 0;
|
||||
} else {
|
||||
print("no\n");
|
||||
exit 1;
|
||||
}
|
||||
exit 0;
|
||||
}
|
||||
|
||||
if ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) {
|
||||
|
|
|
@ -200,11 +200,10 @@ if ( defined($ARGV[0]) ) {
|
|||
if ( $ARGV[0] eq "autoconf" ) {
|
||||
if ( defined($host) and defined($port) and defined($username) and defined($password) ) {
|
||||
print("yes\n");
|
||||
exit 0;
|
||||
} else {
|
||||
print("no\n");
|
||||
exit 1;
|
||||
}
|
||||
exit 0;
|
||||
} elsif ( $ARGV[0] eq "config" ) {
|
||||
print <<'END_GRAPH_CONFIG';
|
||||
graph_title Flash Media Server application connections
|
||||
|
|
|
@ -201,11 +201,10 @@ if ( defined($ARGV[0]) ) {
|
|||
if ( $ARGV[0] eq "autoconf" ) {
|
||||
if ( defined($host) and defined($port) and defined($username) and defined($password) ) {
|
||||
print("yes\n");
|
||||
exit 0;
|
||||
} else {
|
||||
print("no\n");
|
||||
exit 1;
|
||||
}
|
||||
exit 0;
|
||||
} elsif ( $ARGV[0] eq "config" ) {
|
||||
print <<'END_GRAPH_CONFIG';
|
||||
graph_title Flash Media Server application connection rates
|
||||
|
|
|
@ -64,15 +64,13 @@ if [ "$1" = "autoconf" ]; then
|
|||
iptables -L INPUT -v -n -x -w >/dev/null 2>/dev/null
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "no (could not run iptables as user `whoami`)"
|
||||
exit 1
|
||||
else
|
||||
echo yes
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "no (/proc/net/dev not found)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "suggest" ]; then
|
||||
|
|
|
@ -24,11 +24,10 @@
|
|||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -r "$LOG" ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
|
|
@ -122,10 +122,8 @@ EOF
|
|||
autoconf)
|
||||
if [[ $(ifconfig &> /dev/null; echo "$?") == 0 ]]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo "no (ifconfig doesn't work out)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
|
|
|
@ -30,15 +30,13 @@ if [ "$1" = "autoconf" ]; then
|
|||
iptables-save -c >/dev/null 2>/dev/null
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "no (could not run iptables-save as user `whoami`)"
|
||||
exit 1
|
||||
else
|
||||
echo yes
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "no (/proc/net/dev not found)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "suggest" ]; then
|
||||
|
|
|
@ -34,13 +34,13 @@ ipfw="/sbin/ipfw"
|
|||
if [ "$1" = "autoconf" ]; then
|
||||
if [ ! -x $ipfw ]; then
|
||||
echo "no ($ipfw not found)"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
err=$($ipfw nat show config 2>&1)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "no ($err)"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "yes"
|
||||
|
|
|
@ -45,15 +45,13 @@ if [ "$1" = "autoconf" ]; then
|
|||
iptables -L INPUT -v -n -x -w >/dev/null 2>/dev/null
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "no (could not run iptables as user `whoami`)"
|
||||
exit 1
|
||||
else
|
||||
echo yes
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "no (/proc/net/dev not found)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "suggest" ]; then
|
||||
|
|
|
@ -48,15 +48,13 @@ if [ "$1" = "autoconf" ]; then
|
|||
RES=`$iptables -L $TNAME -nvx -w 2>&1 >/dev/null`
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "no (could not run iptables as user `whoami`; $RES)"
|
||||
exit 1
|
||||
else
|
||||
echo yes
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
echo "no (/proc/net/dev not found)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "suggest" ]; then
|
||||
|
|
|
@ -99,12 +99,11 @@ if [ "$1" = "autoconf" ]; then
|
|||
done
|
||||
|
||||
if [ -n "$ONE_LISTENING" ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
echo "yes"
|
||||
else
|
||||
echo no '(no slapd listening on '$PORTS')'
|
||||
exit 1
|
||||
echo "no (no slapd listening on $PORTS)"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
|
|
@ -34,17 +34,15 @@ totrace=`basename $0 | sed 's/^mtr100_//g'`
|
|||
if [ "$1" = "autoconf" ]; then
|
||||
if ( mtr -nrc 1 localhost 2>/dev/null >/dev/null ); then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
if [ $? -eq 127 ]
|
||||
then
|
||||
echo "no (mtr program not found - install the mtr(-tiny) package)"
|
||||
exit 1
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
|
@ -32,11 +32,10 @@ STRIP_OUTPUT="/\($TO_REMOVE\)/d"
|
|||
if [ "$1" = "autoconf" ]; then
|
||||
if [ -r $NETSTATS ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo no
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
|
|
|
@ -46,9 +46,9 @@ if ( exists $ARGV[0] and $ARGV[0] eq 'autoconf' ) {
|
|||
} else {
|
||||
print "no (program $TC died)\n";
|
||||
}
|
||||
exit 1;
|
||||
} else {
|
||||
print "yes\n";
|
||||
}
|
||||
print "yes\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,11 +43,10 @@ elif [ "$1" == "autoconf" ]; then
|
|||
|
||||
if [ -x /usr/bin/time ] && [ -x /usr/bin/nc ]; then
|
||||
echo "yes"
|
||||
exit 0
|
||||
else
|
||||
echo "no (/usr/bin/time or /usr/bin/nc missing)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
|
||||
else
|
||||
|
||||
|
|
|
@ -52,11 +52,10 @@ case "$1" in
|
|||
autoconf)
|
||||
if [ -r /proc/net/dev ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo "no (/proc/net/dev not found)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
suggest)
|
||||
if [ -r /proc/net/dev ]; then
|
||||
|
|
|
@ -23,11 +23,10 @@ case $1 in
|
|||
autoconf)
|
||||
if [ -r /proc/net/dev ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo "no (/proc/net/dev not found)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
suggest)
|
||||
if [ -r /proc/net/dev ]; then
|
||||
|
|
|
@ -23,11 +23,10 @@ case $1 in
|
|||
autoconf)
|
||||
if [ -r /proc/net/dev ]; then
|
||||
echo yes
|
||||
exit 0
|
||||
else
|
||||
echo "no (/proc/net/dev not found)"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
suggest)
|
||||
if [ -r /proc/net/dev ]; then
|
||||
|
|
|
@ -233,9 +233,9 @@ sub load_data {
|
|||
if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) {
|
||||
if ($ret) {
|
||||
print "no ($ret)\n";
|
||||
exit 1;
|
||||
} else {
|
||||
print "yes\n";
|
||||
}
|
||||
print "yes\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue