2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01: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:
Lars Kruse 2018-09-16 15:18:01 +02:00
commit 272220c61a
197 changed files with 380 additions and 588 deletions

View File

@ -116,17 +116,15 @@ fi
if [ "$1" == "autoconf" ]; then
if [ -r /proc/net/dev ]; 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
if [ $? -gt 0 ]; then
echo "no (could not run iptables as user `whoami`)"
else
echo yes
fi
else
echo "no (/proc/net/dev not found)"
exit 1
fi
exit 0
fi
if [ "$1" = "suggest" ]; then

View File

@ -37,11 +37,10 @@ mktempfile () {
if [ "$1" = "autoconf" ]; then
if [ -f "${AMAVIS_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" -a -n "${BC}" -a -x "${BC}" ] ; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -45,11 +45,10 @@ my($db_home) = # DB databases directory
if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if (-x "/usr/sbin/amavisd-agent") {
print "yes\n";
exit 0;
} else {
print "no (/usr/sbin/amavisd-agent not found or not executable)\n";
exit 1;
}
exit 0;
} elsif ($ARGV[0] and $ARGV[0] eq "suggest") {
print "time\n";
print "cache\n";

View File

@ -23,11 +23,10 @@ STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -54,14 +54,13 @@ sub autoconf
if (-d $LOGDIR) {
if (-f $logfile) {
print "yes\n";
exit 0;
} else {
print "no (logfile not found)\n";
}
} else {
print "no (could not find logdir)\n";
}
exit 1;
exit 0;
}
sub config

View File

@ -28,16 +28,15 @@
if [ "$1" = "autoconf" ]; then
if [ -z "$(which amule)" ]; then
echo "$0: error: amule not installed"
exit 1
echo "no (amule not installed)"
else
if [ ! -e /tmp/amulesig.dat ]; then
echo "$0: error: amulesig.dat not found"
echo "no (amulesig.dat not found)"
else
echo yes
exit 0
fi
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -28,16 +28,15 @@
if [ "$1" = "autoconf" ]; then
if [ -z "$(which amule)" ]; then
echo "$0: error: amule not installed"
exit 1
echo "no (amule not installed)"
else
if [ ! -e /tmp/amulesig.dat ]; then
echo "$0: error: amulesig.dat not found"
echo "no (amulesig.dat not found)"
else
echo yes
exit 0
fi
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -28,16 +28,15 @@
if [ "$1" = "autoconf" ]; then
if [ -z "$(which amule)" ]; then
echo "$0: error: amule not installed"
exit 1
echo "no (amule not installed)"
else
if [ ! -e /tmp/amulesig.dat ]; then
echo "$0: error: amulesig.dat not found"
echo "no (amulesig.dat not found)"
else
echo yes
exit 0
fi
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -28,16 +28,15 @@
if [ "$1" = "autoconf" ]; then
if [ -z "$(which amule)" ]; then
echo "$0: error: amule not installed"
exit 1
echo "no (amule not installed)"
else
if [ ! -e /tmp/amulesig.dat ]; then
echo "$0: error: amulesig.dat not found"
echo "no (amulesig.dat not found)"
else
echo yes
exit 0
fi
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -42,7 +42,7 @@ my %chars = (
if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
if ($ret) {
print "no ($ret)\n";
exit 1;
exit 0;
}
my $ua = LWP::UserAgent->new(timeout => 30);
my @badports;
@ -55,7 +55,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
if (@badports) {
print "no (no apache server-status on ports @badports)\n";
exit 1;
exit 0;
} else {
print "yes\n";
exit 0;

View File

@ -23,16 +23,13 @@ then
if ! ls $ACCESSLOG > /dev/null
then
echo "no (could not find apache access log \"$ACCESSLOG\")"
exit 1
elif ! ls $DIRECTORY > /dev/null
then
echo "no (could not find munin plugins directory \"$DIRECTORY\")"
exit 2
else
echo "yes"
exit 0
fi
exit 0
fi
# ######################################################################################### INIT

View File

@ -39,7 +39,7 @@ my $type = "throughput";
if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
if ($ret) {
print "no ($ret)\n";
exit 1;
exit 0;
}
my $ua = LWP::UserAgent->new (timeout => 30);
my @badports;
@ -52,7 +52,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
if (@badports) {
print "no (no mod_watch exists on ports @badports)\n";
exit 1;
exit 0;
} else {
print "yes\n";
exit 0;

View File

@ -15,10 +15,11 @@
if [ "$1" = "autoconf" ]; then
# Search for arp
which arp >/dev/null 2>/dev/null || (echo "no (can't find arp binary)" && exit 1)
# ...or success
echo yes
if which arp >/dev/null; then
echo yes
else
echo "no (missing 'arp' executable)"
fi
exit 0
fi

View File

@ -19,13 +19,11 @@
case "$1" in
autoconf)
# Search for ip
which ip >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "no (can't find ip binary)"
exit 1
if which ip >/dev/null; then
echo 'yes'
else
echo "no (missing 'ip' executable)"
fi
# ...or success
echo 'yes'
exit 0
;;
suggest)

View File

@ -11,15 +11,13 @@ if [ "$1" = "autoconf" ]; then
asterisk -rx 'sip show inuse' > /dev/null
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
else
echo no
exit 1
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -18,9 +18,12 @@ HOSTS=$(cd ${PCDIR} 2>/dev/null && ls -1)
. $MUNIN_LIBDIR/plugins/plugin.sh
if [ "$1" = "autoconf" ]; then
[ ! -z "${HOSTS}" ] && echo "yes" && exit 0
echo "no"
exit 1
if [ -n "$HOSTS" ]; then
echo "yes"
else
echo "no"
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -32,11 +32,10 @@
if [ "$1" = "autoconf" ]; then
if grep -q 'present.*yes' /proc/acpi/battery/*/info > /dev/null 2>&1; then
echo yes
exit 0
else
echo "no (battery not detected)"
exit 1
fi
exit 0
fi
cd /proc/acpi/battery

View File

@ -29,7 +29,6 @@ mktempfile () {
if [ "$1" = "autoconf" ]; then
if [ -n "${B3NAME}" -a -f "${logfile}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ]; then
echo yes
exit 0
else
echo -n "no"
if [ ! -n "${B3NAME}" ]; then
@ -43,8 +42,8 @@ if [ "$1" = "autoconf" ]; then
elif [ ! -x "${LOGTAIL}" ]; then
echo " (cannot execute ${LOGTAIL})"
fi
exit 1
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -122,12 +122,12 @@ if ( defined($ARGV[0]) && $ARGV[0] eq "config" ) {
if ( defined($ARGV[0]) && $ARGV[0] eq "autoconf" ) {
if (! -f $stat_file) {
printf "Unable to file bind stat file on %s",$stat_file;
exit 1;
printf "no (Unable to file bind stat file on %s)",$stat_file;
exit 0;
}
if (! -f $rndc) {
printf "Unable to file rndc tool (configured : %s)",$rndc;
exit 1;
printf "no (Unable to file rndc tool (configured : %s))",$rndc;
exit 0;
}
exit 0;
}

View File

@ -98,11 +98,11 @@ if ( defined($ARGV[0]) && $ARGV[0] eq "config" ) {
if ( defined($ARGV[0]) && $ARGV[0] eq "autoconf" ) {
if (! -f $stat_file) {
printf "Unable to file bind stat file on %s",$stat_file;
exit 1;
exit 0;
}
if (! -f $rndc) {
printf "Unable to file rndc tool (configured : %s)",$rndc;
exit 1;
exit 0;
}
exit 0;
}

View File

@ -111,11 +111,10 @@ sub get_stats {
sub autoconf {
if (-S $socket) {
say 'yes';
exit 0;
} else {
say 'no';
exit 1;
}
exit 0;
}
sub config {

View File

@ -63,7 +63,7 @@ sub autoconf {
}
}
print "no\n";
exit 1;
exit 0;
}
sub config {

View File

@ -52,7 +52,7 @@ fi
if [ "$1" = "autoconf" ]; then
echo "no"
exit 1
exit 0
fi
if [ "$1" = "suggest" ]; then

View File

@ -53,7 +53,7 @@ fi
if [ "$1" = "autoconf" ]; then
echo "no"
exit 1
exit 0
fi
if [ "$1" = "suggest" ]; then

View File

@ -55,7 +55,7 @@ fi
if [ "$1" = "autoconf" ]; then
echo "no"
exit 1
exit 0
fi
if [ "$1" = "suggest" ]; then

View File

@ -52,7 +52,7 @@ fi
if [ "$1" = "autoconf" ]; then
echo "no"
exit 1
exit 0
fi
if [ "$1" = "suggest" ]; then

View File

@ -58,11 +58,10 @@ ID=1;
if [ "$1" = "autoconf" ]; then
if [ -d $DIR ]; then
echo "yes"
exit 0
else
echo "no (check your path)"
exit 1
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -57,11 +57,10 @@ lse2() {
if [ "$1" = "autoconf" ]; then
if which dumpe2fs >/dev/null 2>&1; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
if [ "$1" = "suggest" ]; then
lse2 | while read name rest; do

View File

@ -60,7 +60,6 @@ if (defined($ARGV[0])) {
my @chk_result = `$hpasmcli -s \"help\"`;
if ($? eq "0") {
print "yes\n";
exit 0;
} else {
my $reason = 'Unknown error';
foreach my $line (@chk_result) {
@ -71,12 +70,11 @@ if (defined($ARGV[0])) {
}
}
print "no ($reason)\n";
exit 1;
}
} else {
print "no (hpasmcli not found)\n";
exit 1;
}
exit 0;
} elsif ($ARGV[0] eq 'suggest') {
print "temp\nfans\n";
exit 0;

View File

@ -147,12 +147,11 @@ if ( defined $ARGV[0] && $ARGV[0] eq 'autoconf' ) {
if ( !$@ && keys %stats ) {
print "yes\n";
exit 0;
}
else {
print "no\n";
exit 1;
}
exit 0;
}

View File

@ -26,10 +26,10 @@ lvdisplay=$(which lvdisplay)
if [ "$1" = "autoconf" ]; then
if test -n "${lvdisplay}"; then
echo yes
exit 0
else
echo "no (lvdisplay not found)"
fi
echo "no lvdisplay found"
exit 1
exit 0
fi

View File

@ -96,10 +96,10 @@ $mdstat_present = -f '/proc/mdstat';
if ( defined($ARGV[0]) and $ARGV[0] eq "autoconf") {
if ($mdstat_present and ($detailed_present or $stat_present)) {
print "yes\n";
exit 0;
} else {
print "no\n";
}
print "no\n";
exit 1;
exit 0;
}
my %devs;

View File

@ -126,11 +126,10 @@ my %config = (
if ($ARGV[0] and $ARGV[0] eq "autoconf" ) {
if (-e $Command ) {
print "yes\n";
exit 0;
} else {
print "no\n";
exit 1
}
exit 0;
}
#Read Output of MegaRaid command

View File

@ -13,11 +13,10 @@
if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if (-r "/proc/mdstat" and `grep md /proc/mdstat`) {
print "yes\n";
exit 0;
} else {
print "no RAID devices\n";
exit 1;
print "no (no RAID devices found)\n";
}
exit 0;
}
if ( $ARGV[0] and $ARGV[0] eq "config" ) {

View File

@ -30,14 +30,12 @@ returnval=$?
if [ "x$1" = "xautoconf" ]; then
if [ -z "$targets" ]; then
echo "no (no md devices found under /sys/devices/virtual/block/*/md/mismatch_cnt)"
exit 1;
elif [ "x$returnval" != "x0" ]; then
echo "no (discovery of md devices failed strangely)"
exit 1;
else
echo "yes"
exit 0
fi
exit 0
fi
if [ "x$1" = "xconfig" ]; then

View File

@ -20,13 +20,12 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf")
if (-r "/proc/fs/xfs/stat")
{
print "yes\n";
exit 0;
}
else
{
print "/proc/fs/xfs/stat not found\n";
exit 1;
print "no (/proc/fs/xfs/stat not found)\n";
}
exit 0;
}
my %runtime_stats = (

View File

@ -37,11 +37,10 @@ STATEFILE=$MUNIN_PLUGSTATE/dkimproxy_mails.offset
if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -36,12 +36,12 @@ if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
if (! -x $DOVEADM) {
print "no (no doveadm)\n";
exit(1);
exit(0);
}
if (! -f $logfile) {
print "no (logfile $logfile does not exist)\n";
exit(1);
exit(0);
}
if (-r "$logfile") {
@ -50,7 +50,7 @@ if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
} else {
print "no (logfile not readable)\n";
}
exit 1;
exit 0;
}
if (-f "$logfile.0") {

View File

@ -19,11 +19,10 @@
if [ "$1" = "autoconf" ]; then
if [ -r /proc/acpi/ibm/fan ]; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi

View File

@ -20,11 +20,10 @@ FAXQ=${faxq:=/usr/sbin/faxqclean}
if [ "$1" = "autoconf" ]; then
if [ -x ${FAXSTAT} ] ; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
JOBTYPES="Running Waiting Done"

View File

@ -42,11 +42,11 @@ if [ "$1" = "autoconf" ]; then
exit 0
else
echo "no (logtail not found)"
exit 1
exit 0
fi
else
echo "no (logfile $LOGFILE does not exist)"
exit 1
exit 0
fi
fi

View File

@ -32,11 +32,11 @@ if [ "$1" = "autoconf" ]; then
exit 0
else
echo "no (logtail not found)"
exit 1
exit 0
fi
else
echo "no (logfile ${LOGFILE} does not exist)"
exit 1
exit 0
fi
fi

View File

@ -8,7 +8,7 @@ if [ "$1" = "autoconf" ]; then
exit 0
else
echo no
exit 1
exit 0
fi
fi

View File

@ -56,7 +56,7 @@ then
exit 0
else
echo no
exit 1
exit 0
fi
fi

View File

@ -40,14 +40,12 @@
# Auto Configure, Check it word 1 is defined
if [ "$1" = "autoconf" ]; then
if [ "$URL1" != "" ]; then
if [ "$WORD1" != "" ]; then
echo yes
exit 0
fi
if [ -n "$URL1" ] && [ -n "$WORD1" ]; then
echo yes
else
echo no
fi
echo no
exit 1
exit 0
fi
#Configure, loop through each variable defined WORDx URLx dumping it to munin

View File

@ -83,7 +83,7 @@ when "autoconf"
exit 0
end
puts "no"
exit 1
exit 0
else
mpm.run
end

View File

@ -94,7 +94,7 @@ when "autoconf"
exit 0
end
puts "no"
exit 1
exit 0
else
mpm.run
end

View File

@ -97,30 +97,20 @@ default_timeout=20
default_join_lines=true
if [ "${1}" = "autoconf" ]; then
result=0
if [ -z "${wget_bin}" -o ! -f "${wget_bin}" -o ! -x "${wget_bin}" ]; then
result=1
if [ -z "$wget_bin" ] || [ ! -f "$wget_bin" ] || [ ! -x "$wget_bin" ]; then
echo "no (missing 'wget' executable)"
elif [ -z "$time_bin" ] || [ ! -f "$time_bin" ] || [ ! -x "$time_bin" ]; then
echo "no (missing 'time' executable)"
elif [ -z "$mktemp_bin" ] || [ ! -f "$mktemp_bin" ] || [ ! -x "$mktemp_bin" ]; then
echo "no (missing 'mktemp' executable)"
elif [ -z "$grep_bin" ] || [ ! -f "$grep_bin" ] || [ ! -x "$grep_bin" ]; then
echo "no (missing 'grep' executable)"
elif [ -z "$tail_bin" ] || [ ! -f "$tail_bin" ] || [ ! -x "$tail_bin" ]; then
echo "no (missing 'tail' executable)"
else
if [ -z "${time_bin}" -o ! -f "${time_bin}" -o ! -x "${time_bin}" ]; then
result=2
else
if [ -z "${mktemp_bin}" -o ! -f "${mktemp_bin}" -o ! -x "${mktemp_bin}" ]; then
result=3
else
if [ -z "${grep_bin}" -o ! -f "${grep_bin}" -o ! -x "${grep_bin}" ]; then
result=4
else
[ -z "${tail_bin}" -o ! -f "${tail_bin}" -o ! -x "${tail_bin}" ] && result=5
fi
fi
fi
fi
if [ ${result} -eq 0 ]; then
echo "yes"
else
echo "no"
fi
exit $result
exit 0
fi
if [ -z "${names}" ]; then

View File

@ -26,11 +26,11 @@ case $1 in
autoconf|detect)
if [ -d $ICEDIR/ ] ; then
echo yes
exit 0
else
echo "no (icedir not found)"
exit 1
fi;;
fi
exit 0
;;
config)
cat <<'EOF'
graph_title Icecast2 Stream Listeners

View File

@ -31,15 +31,13 @@ if [ "$1" = "autoconf" ]; then
ip6tables -L INPUT -v -n -x -w >/dev/null 2>/dev/null
if [ $? -gt 0 ]; then
echo "no (could not run ip6tables 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

View File

@ -110,15 +110,13 @@ if [ "$1" = "autoconf" ]; then
if [ ! -x "${JAVA_HOME}/bin/jstat" ]; then
echo "no (No jstat found in ${JAVA_HOME}/bin)"
exit 1
elif [ ! -f "$pidfilepath" ]; then
echo "no (missing file $pidfilepath)"
elif [ ! -r "$pidfilepath" ]; then
echo "no (cannot read $pidfilepath)"
else
echo "yes"
fi
if [ ! -f "${pidfilepath}" ] || [ ! -r "${pidfilepath}" ]; then
echo "no (No such file ${pidfilepath} or cannot read ${pidfilepath}"
exit 1
fi
echo "yes"
exit 0
fi

View File

@ -130,15 +130,13 @@ if [ "$1" = "autoconf" ]; then
if [ ! -x "${JAVA_HOME}/bin/jstat" ]; then
echo "no (No jstat found in ${JAVA_HOME}/bin)"
exit 1
elif [ ! -f "$pidfilepath" ]; then
echo "no (missing file $pidfilepath)"
elif [ ! -r "$pidfilepath" ]; then
echo "no (cannot read $pidfilepath)"
else
echo "yes"
fi
if [ ! -f "${pidfilepath}" ] || [ ! -r "${pidfilepath}" ]; then
echo "no (No such file ${pidfilepath} or cannot read ${pidfilepath}"
exit 1
fi
echo "yes"
exit 0
fi

View File

@ -185,15 +185,13 @@ if [ "$1" = "autoconf" ]; then
if [ ! -x "${JAVA_HOME}/bin/jstat" ]; then
echo "no (No jstat found in ${JAVA_HOME}/bin)"
exit 1
elif [ ! -f "$pidfilepath" ]; then
echo "no (missing file $pidfilepath)"
elif [ ! -r "$pidfilepath" ]; then
echo "no (cannot read $pidfilepath)"
else
echo "yes"
fi
if [ ! -f "${pidfilepath}" ] || [ ! -r "${pidfilepath}" ]; then
echo "no (No such file ${pidfilepath} or cannot read ${pidfilepath}"
exit 1
fi
echo "yes"
exit 0
fi

View File

@ -16,18 +16,15 @@
if [ "$1" = "autoconf" ]; then
if [ -x /sbin/sysctl ]; then
/sbin/sysctl vm.kmem_size_max > /dev/null
if [ $? = "0" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
if /sbin/sysctl vm.kmem_size_max >/dev/null 2>&1; then
echo "yes"
else
echo "no (missing sysctl variable 'vm.kmem_size_max')"
fi
else
echo no
exit 1
echo "no (missing 'sysctl' executable)"
fi
exit 0
fi
TEXT=`kldstat | tr a-f A-F | awk 'BEGIN {print "ibase=16"}; NR > 1 {print $4}' | bc | awk '{a+=$1}; END {print a}'`

View File

@ -14,11 +14,10 @@ pid=`pgrep -o -x "$process"`
if [ "$1" = "autoconf" ]; then
if [ -r /proc/$pid/status ]; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -61,7 +61,7 @@ sub autoconf {
if ($ret)
{
print "no ($ret)\n";
exit 1;
exit 0;
}
my $conn = IO::Socket::INET->new(PeerAddr => $host,
@ -72,7 +72,7 @@ sub autoconf {
if (!$conn)
{
print "no (could not connect: $!)\n";
exit 1;
exit 0;
}
my $request = "!stats\n";

View File

@ -61,7 +61,7 @@ sub autoconf {
if ($ret)
{
print "no ($ret)\n";
exit 1;
exit 0;
}
my $conn = IO::Socket::INET->new(PeerAddr => $host,
@ -72,7 +72,7 @@ sub autoconf {
if (!$conn)
{
print "no (could not connect: $!)\n";
exit 1;
exit 0;
}
my $request = "!stats\n";

View File

@ -83,15 +83,11 @@ ACTION="$(basename "$0" | sed 's/^.*_//')"
do_autoconf () {
if [ -z "$NCBIN" ] ; then
echo "no (missing netcat program ('nc'))"
exit 1
fi
if ! echo version | "$NCBIN" "$MPDHOST" "$MPDPORT" >/dev/null 2>&1; then
elif ! echo version | "$NCBIN" "$MPDHOST" "$MPDPORT" >/dev/null 2>&1; then
echo "no (connection failed)"
exit 1
else
echo "yes"
fi
echo "yes"
exit 0
}

View File

@ -78,9 +78,9 @@ MINUTE_BY_GREP_RANGE=10
if [ "$1" = "autoconf" ]; then
if [ $CHECKMAX -le 1 ]; then
echo no
exit 1
else
echo yes
fi
echo yes
exit 0
fi

View File

@ -40,9 +40,9 @@ let CHECKMAX="$CHECKMAX + 1"
if [ "$1" = "autoconf" ]; then
if [ $CHECKMAX -le 1 ]; then
echo no
exit 1
else
echo yes
fi
echo yes
exit 0
fi

View File

@ -90,9 +90,9 @@ CURL=/usr/bin/curl
if [ "$1" = "autoconf" ]; then
if [ $CHECKMAX -le 1 ]; then
echo no
exit 1
else
echo yes
fi
echo yes
exit 0
fi

View File

@ -40,11 +40,11 @@ fi
if [ "$1" = "autoconf" ]; then
if [ -f $UPDATE_STATSFILE ]; then
echo "yes"
exit 0
echo "yes"
else
echo "no (logfile not readable)"
fi
echo "no (logfile not readable)"
exit 1
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -60,13 +60,12 @@ default_args="--base 1000 -l 0"
default_scale="no"
if [ "${1}" = "autoconf" ]; then
result=0
if [ -z "${mysqlbin}" ]; then
echo "no"
echo "no (missing mysql executable)"
else
echo "yes"
fi
exit $result
exit 0
fi
if [ -z "${names}" ]; then

View File

@ -42,11 +42,10 @@ then
if du -sb $DIR &> /dev/null
then
echo "yes"
exit 0
else
echo "no"
exit 1
fi
exit 0
elif [ "${1:-}" = "config" ]
then
echo "graph_title MySQL on-disk database size"

View File

@ -18,19 +18,15 @@ Tuner=0
case $1 in
autoconf|detect)
REQ=`which femon`
if [ "$REQ" = "" ]; then
if ! which femon >/dev/null; then
echo "no (femon not installed)"
exit 1
fi
if [ -e /dev/dvb/adapter$Tuner/ ]; then
elif [ -e "/dev/dvb/adapter$Tuner/" ]; then
echo yes
exit 0
else
echo "no (dvb tuner $Tuner not found)"
exit 1
fi;;
fi
exit 0
;;
config)
echo "graph_title DVB signal strength"

View File

@ -42,12 +42,10 @@ my $Channel="";
if ($ARGV[0] and $ARGV[0] eq "autoconf" ) {
if ( $SQLDBName ne "" ) {
print "yes\n";
exit 0;
} else {
print "no\n";
print "cannot find MythTV configuration file my.txt\n";
exit 1;
print "no (cannot find MythTV configuration file my.txt)\n";
}
exit 0;
}
#Config Options

View File

@ -46,11 +46,10 @@ if ($ARGV[0]) {
if ($ARGV[0] eq 'autoconf') {
if (-r $NAGIOSSTAT) {
print "yes";
exit 0;
} else {
print "no (Nagios status file not found)";
exit 1;
}
exit 0;
} elsif ($ARGV[0] eq "config") {
print "graph_args --base 1000 -l 0 --vertical-label Checks\n";
print "graph_title Nagios status\n";

View File

@ -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

View File

@ -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

View File

@ -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" ) {

View File

@ -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

View File

@ -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) ) {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
;;

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -48,11 +48,10 @@ proc="access close commit create delegpurge delegreturn getattr getfh link lock
if [ "$1" = "autoconf" ]; then
if [ -f "$NFSD" ]; then
echo yes
exit 0
else
echo "no (no $NFSD)"
exit 1
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -48,7 +48,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" )
{
if ($ret){
print "no ($ret)\n";
exit 1;
exit 0;
}
my $ua = LWP::UserAgent->new(timeout => 30);
@ -57,7 +57,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" )
unless ($response->is_success and $response->content =~ /server/im)
{
print "no (no nginx status on $URL)\n";
exit 1;
exit 0;
}
else
{

View File

@ -112,7 +112,7 @@ my $UA = exists $ENV{'ua'} ? $ENV{'ua'} : 'nginx-status-verifier/0.1';
if (exists $ARGV[0] and $ARGV[0] eq "autoconf" ) {
if ($ret) {
print "no ($ret)\n";
exit 1;
exit 0;
}
my $ua = LWP::UserAgent->new(timeout => 30);
# Set the UA to something different from the libwww-perl.
@ -122,7 +122,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf" ) {
unless ($response->is_success and $response->content =~ /server/im) {
print "no (no nginx status on $URL)\n";
exit 1;
exit 0;
} else {
print "yes\n";
exit 0;

View File

@ -69,15 +69,13 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if ($? eq "0") {
if (`$NTPQ -np | wc -l` > 0) {
print "yes\n";
exit 0;
} else {
print "no (unable to list peers)\n";
exit 1;
}
} else {
print "no (ntpq not found)\n";
exit 1;
}
exit 0;
}
my %peers;

View File

@ -55,15 +55,13 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if ($? eq "0") {
if (`$NTPQ -np | wc -l` > 0) {
print "yes\n";
exit 0;
} else {
print "no (unable to list peers)\n";
exit 1;
}
} else {
print "no (ntpq not found)\n";
exit 1;
}
exit 0;
}
my %peers;

View File

@ -51,15 +51,13 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if ($? eq "0") {
if (`$NTPDC -c sysstats | wc -l` > 0) {
print "yes\n";
exit 0;
} else {
print "no (unable to list system stats)\n";
exit 1;
}
} else {
print "no (ntpdc not found)\n";
exit 1;
}
exit 0;
}
my $queries = 0;

View File

@ -12,11 +12,10 @@ BEANCOUNTERS=/proc/user_beancounters
if [ "$1" == "autoconf" ]; then
if [ -e $BEANCOUNTERS ]; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
if [ ! -r $BEANCOUNTERS ]; then

View File

@ -66,14 +66,14 @@ if (exists $ARGV[0]) {
# Check for DBD::Oracle
if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)";
exit 1;
exit 0;
}
if ($dbh) {
print "yes\n";
exit 0;
} else {
print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr;
exit 1;
exit 0;
}
}

View File

@ -63,14 +63,14 @@ if (exists $ARGV[0]) {
# Check for DBD::Oracle
if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)";
exit 1;
exit 0;
}
if ($dbh) {
print "yes\n";
exit 0;
} else {
print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr;
exit 1;
exit 0;
}
}

View File

@ -64,14 +64,14 @@ if (exists $ARGV[0]) {
# Check for DBD::Oracle
if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)";
exit 1;
exit 0;
}
if ($dbh) {
print "yes\n";
exit 0;
} else {
print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr;
exit 1;
exit 0;
}
}

Some files were not shown because too many files have changed in this diff Show More