From Tom.Bertelson at gecapital.com Wed Jun 5 10:24:04 2002 From: Tom.Bertelson at gecapital.com (Bertelson, Tom (CAP, CARD)) Date: Wed Jun 5 10:24:04 2002 Subject: [Nagiosplug-devel] Patches to Plugins Message-ID: <41BE560FEB5CD411AB0100D0B784C03901F49C88@exc004gptccsge.cfs.capital.ge.com> Here are some patches I came up with to get the plugins working for my Solaris environment. They should work for other platforms, too. configure.in: ntpdc may be called xntpdc check_flexlm: Gracefully fail if lmstat not found check_log: Work more like contrib/check_log2. WARNING: This may not be backward compatible with the original check_log. check_ntp: Work even if ntpdc not found check_oracle: Add test for Oracle names server, can dynamically determine ORACLE_HOME subst: Can mess up substitutions utils.sh: Not POSIXLY_CORRECT check_disk: Add flag to display mount points instead of partitions, produce output even if df has errrors (I hope !#%!@* Outlook doesn't mangle this too badly) Enjoy! -- Tom Bertelson "Any sufficient advanced technlogy GE Card Services is indistinguishable from magic." Tom.Bertelson at gecapital.com -- Arthur C. Clarke --- configure.in.orig Sun May 26 22:03:37 2002 +++ configure.in Tue Jun 4 20:56:08 2002 @@ -488,6 +504,8 @@ elif [ps -el 2>/dev/null | egrep -i "^ *F +S +UID +PID +PPID +C +PRI +NI +ADDR +SZ +WCHAN +TTY +TIME +[RGSCOMDNA]+" >/dev/null] then AC_DEFINE(USE_PS_VARS) + AC_DEFINE_UNQUOTED(PS_RAW_COMMAND,"$PATH_TO_PS -ef") + EXTRAS="$EXTRAS check_nagios" AC_DEFINE_UNQUOTED(PS_VARLIST,[procstat,&procuid,&procppid,&pos,procprog]) AC_DEFINE_UNQUOTED(PS_COMMAND,"$PATH_TO_PS -el") AC_DEFINE_UNQUOTED(PS_FORMAT,"%*s %s %d %*s %d %*s %*s %*s %*s %*s %*s %*s %*s %n%s") @@ -649,7 +667,7 @@ AC_DEFINE_UNQUOTED(PATH_TO_RPCINFO,"$PATH_TO_RPCINFO") AC_PATH_PROG(PATH_TO_NTPDATE,ntpdate) -AC_PATH_PROG(PATH_TO_NTPDC,ntpdc) +AC_PATH_PROGS(PATH_TO_NTPDC,ntpdc xntpdc) if (test -x "$PATH_TO_NTPDATE" || test -x "$PATH_TO_NTPDC") then AC_DEFINE_UNQUOTED(PATH_TO_NTPDC,"$PATH_TO_NTPDC") --- plugins-scripts/check_flexlm.pl.orig Tue May 7 01:35:49 2002 +++ plugins-scripts/check_flexlm.pl Tue Jun 4 20:56:08 2002 @@ -66,7 +66,11 @@ }; alarm($TIMEOUT); -my $lmstat = "/opt/lic/sw/cadadm/default/bin/lmstat"; +my $lmstat = $utils::PATH_TO_LMSTAT; +unless (-x $lmstat) { + print "Cannot find \"$lmstat\"\n"; + exit $ERRORS{'UNKNOWN'}; +} ($opt_F) || ($opt_F = shift) || usage("License file not specified\n"); my $licfile = $1 if ($opt_F =~ /^(.*)$/); --- plugins-scripts/check_log.sh.orig Thu Feb 28 01:43:00 2002 +++ plugins-scripts/check_log.sh Tue Jun 4 20:56:08 2002 @@ -62,10 +62,10 @@ ECHO="/bin/echo" GREP="/bin/grep" -DIFF="/bin/diff" TAIL="/bin/tail" -CAT="/bin/cat" -RM="/bin/rm" +LS="/bin/ls" +NAWK="/bin/nawk" +HEAD="/bin/head" PROGNAME=`/bin/basename $0` PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` @@ -74,7 +74,7 @@ . $PROGPATH/utils.sh print_usage() { - echo "Usage: $PROGNAME -F logfile -O oldlog -q query" + echo "Usage: $PROGNAME -F logfile -O oldlog -q query -T tailcmd" echo "Usage: $PROGNAME --help" echo "Usage: $PROGNAME --version" } @@ -153,6 +153,10 @@ exitstatus=$2 shift ;; + -T|--tailcmd) + TAIL=$2 + shift + ;; *) echo "Unknown argument: $1" print_usage @@ -164,7 +168,7 @@ # If the source log file doesn't exist, exit -if [ ! -e $logfile ]; then +if [ ! -f $logfile ]; then $ECHO "Log check error: Log file $logfile does not exist!\n" exit 2 fi @@ -173,42 +177,42 @@ # we're running this test, so copy the original log file over to # the old diff file and exit -if [ ! -e $oldlog ]; then - $CAT $logfile > $oldlog - $ECHO "Log check data initialized...\n" - exit 0 -fi +umask 066 +#if [ "$oldlog" != /dev/null -a ! -f $oldlog ]; then +# $LS -lidL $logfile > $oldlog +# $ECHO "Log check data initialized...\n" +# exit $STATE_OK +#fi # The old log file exists, so compare it to the original log now - -# The temporary file that the script should use while -# processing the log file. -if [-x /bin/mktemp]; then - tempdiff="/bin/mktemp /tmp/check_log.XXXXXXXXXX" +# 93593 -rw-r--r-- 1 root other 109889 May 29 14:45 /var/adm/messages +set -- `$LS -lidL $logfile` +inum=$1; perm=$2; nlinks=$3; uid=$4; gid=$5; size=$6; date="$7 $8 $9" +if [ $oldlog = "/dev/null" -o ! -f $oldlog ] ; then + oinum=$inum; osize=0 else - tempdiff="/tmp/check_log.`/bin/date '+%H%M%S'`" - /bin/touch $tempdiff - chmod 600 $tempdiff + set -- `$HEAD -1 $oldlog` + oinum=$1; operm=$2; onlinks=$3; ouid=$4; ogid=$5; osize=$6; odate="$7 $8 $9" fi -$DIFF $logfile $oldlog > $tempdiff - -# Count the number of matching log entries we have -count=`$GREP -c "$query" $tempdiff` - -# Get the last matching entry in the diff file -lastentry=`$GREP "$query" $tempdiff | $TAIL --lines=1` - -$RM -f $tempdiff -$CAT $logfile > $oldlog - -if [ "$count" = "0" ]; then # no matches, exit with no error - $ECHO "Log check ok - 0 pattern matches found\n" - exitstatus=0 -else # Print total matche count and the last entry we found - $ECHO "($count) $lastentry" +$LS -lidL $logfile > $oldlog +if [ "$inum" != "$oinum" -o "$size" -lt "$osize" ]; then + # Re-initialize + osize=0 fi -exit exitstatus - - +$TAIL +${osize}c $logfile | $NAWK ' +# Cannot handle "/"s in $query +# /'"$query"'/ { count++; lastentry = $0 } +# Works, but requires nawk +{ if (match($0, "'"$query"'")) { count++; lastentry = $0; } } +END { + if (count == 0) { + print "Log check ok - 0 pattern matches found"; + exit 0; + } else { + print "(" count ") " lastentry; + exit '$exitstatus'; + } +}' +exit $? --- plugins-scripts/check_ntp.pl.orig Sun May 26 22:10:07 2002 +++ plugins-scripts/check_ntp.pl Tue Jun 4 20:56:08 2002 @@ -119,6 +119,7 @@ my $dispersion_error = $ERRORS{'UNKNOWN'}; my $key = undef; +my $have_ntpdc; # Just in case of problems, let's not hang Nagios $SIG{'ALRM'} = sub { @@ -176,22 +177,26 @@ ### and look in the 8th column for dispersion (ntpd v4) or jitter (ntpd v3) ### -if ( open(NTPDC,"$utils::PATH_TO_NTPDC -s $host 2>&1 |") ) { - while () { - print $_ if ($verbose); - if (/([^\s]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\ s+([-0-9.]+)\s+([-0-9.]+)/) { - if ($8>15) { - print "Dispersion = $8 \n" if ($verbose); - $dispersion_error = $ERRORS{'CRITICAL'}; - } elsif ($8>5 && $dispersion_error<$ERRORS{'CRITICAL'}) { - print "Dispersion = $8 \n" if ($verbose); - $dispersion_error = $ERRORS{'WARNING'}; - } else { - $dispersion_error = $ERRORS{'OK'}; +$have_ntpdc = 0; +if ($utils::PATH_TO_NTPDC && -x $utils::PATH_TO_NTPDC) { + $have_ntpdc = 1; + if ( open(NTPDC,"$utils::PATH_TO_NTPDC -s $host 2>&1 |") ) { + while () { + print $_ if ($verbose); + if (/([^\s]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\s+([-0-9.]+)\ s+([-0-9.]+)\s+([-0-9.]+)/) { + if ($8>15) { + print "Dispersion = $8 \n" if ($verbose); + $dispersion_error = $ERRORS{'CRITICAL'}; + } elsif ($8>5 && $dispersion_error<$ERRORS{'CRITICAL'}) { + print "Dispersion = $8 \n" if ($verbose); + $dispersion_error = $ERRORS{'WARNING'}; + } else { + $dispersion_error = $ERRORS{'OK'}; + } } } + close NTPDC; } - close NTPDC; } @@ -205,7 +210,7 @@ $answer = "Server error and time difference $offset seconds greater than +/- $warning sec\n"; } -} elsif ($dispersion_error != $ERRORS{'OK'}) { +} elsif ($have_ntpdc && $dispersion_error != $ERRORS{'OK'}) { $state = $dispersion_error; $answer = "Dispersion too high\n"; if (defined($offset) && abs($offset) > $critical) { --- plugins-scripts/check_oracle.sh.orig Thu Feb 28 01:43:00 2002 +++ plugins-scripts/check_oracle.sh Tue Jun 4 20:56:08 2002 @@ -36,6 +36,7 @@ echo "Usage:" echo " $PROGNAME --tns " echo " $PROGNAME --db " + echo " $PROGNAME --oranames " echo " $PROGNAME --help" echo " $PROGNAME --version" } @@ -52,13 +53,15 @@ echo "--db=SID" echo " Check local database (search /bin/ps for PMON process and check" echo " filesystem for sgadefORACLE_SID.dbf" + echo "--oranames=Hostname" + echo " Check remote Oracle Names server" echo "--help" echo " Print this help screen" echo "--version" echo " Print version and license information" echo "" - echo "If the plugin doesn't work, check that the $ORACLE_HOME environment" - echo "variable is set, that $ORACLE_HOME/bin is in your PATH, and the" + echo "If the plugin doesn't work, check that the ORACLE_HOME environment" + echo "variable is set, that ORACLE_HOME/bin is in your PATH, and the" echo "tnsnames.ora file is locatable and is properly configured." echo "" echo "When checking Local Database status your ORACLE_SID is case sensitive." @@ -78,27 +81,76 @@ ;; esac +# Hunt down a reasonable ORACLE_HOME +if [ -z "$ORACLE_HOME" ] ; then + # Adjust to taste + for oratab in /var/opt/oracle/oratab /etc/oratab + do + [ ! -f $oratab ] && continue + ORACLE_HOME=`IFS=: + while read SID ORACLE_HOME junk; + do + if [ "$SID" = "$2" ] ; then + echo $ORACLE_HOME; + exit; + fi; + done < $oratab` + [ -n "$ORACLE_HOME" ] && break + done +fi +# Last resort +[ -z "$ORACLE_HOME" -a -d $PROGPATH/oracle ] && ORACLE_HOME=$PROGPATH/oracle + +if [ -z "$ORACLE_HOME" -o ! -d "$ORACLE_HOME" ] ; then + echo "Cannot determine ORACLE_HOME for sid $2" + exit $STATE_UNKNOWN +fi +PATH=$PATH:$ORACLE_HOME/bin +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib +export ORACLE_HOME PATH LD_LIBRARY_PATH + case "$cmd" in --tns) - export tnschk=` tnsping $2` - export tnschk2=` echo $tnschk | grep -c OK` - export tnschk3=` echo $tnschk | cut -d\( -f7 | sed y/\)/" "/` + tnschk=` tnsping $2` + tnschk2=` echo $tnschk | grep -c OK` if [ ${tnschk2} -eq 1 ] ; then + tnschk3=` echo $tnschk | sed -e 's/.*(//' -e 's/).*//'` echo "OK - reply time ${tnschk3} from $2" - exit 0 + exit $STATE_OK else echo "No TNS Listener on $2" exit $STATE_CRITICAL fi ;; +--oranames) + namesctl status $2 | awk ' + /Server has been running for:/ { + msg = "OK: Up" + for (i = 6; i <= NF; i++) { + msg = msg " " $i + } + status = '$STATE_OK' + } + /error/ { + msg = "CRITICAL: " $0 + status = '$STATE_CRITICAL' + } + END { + print msg + exit status + }' + ;; --db) - export pmonchk=`ps -ef | grep -v grep | grep ${2} | grep -c pmon` - if [ -e $ORACLE_HOME/dbs/sga*${2}* ] ; then - if [ ${pmonchk} -eq 1 ] ; then - export utime=`ls -la $ORACLE_HOME/dbs/sga*$2* | cut -c 43-55` - echo "${2} OK - running since ${utime}" - exit $STATE_OK - fi + pmonchk=`ps -ef | grep -v grep | grep ${2} | grep -c pmon` + if [ ${pmonchk} -ge 1 ] ; then + echo "${2} OK - ${pmonchk} PMON process(es) running" + exit $STATE_OK + #if [ -f $ORACLE_HOME/dbs/sga*${2}* ] ; then + #if [ ${pmonchk} -eq 1 ] ; then + #utime=`ls -la $ORACLE_HOME/dbs/sga*$2* | cut -c 43-55` + #echo "${2} OK - running since ${utime}" + #exit $STATE_OK + #fi else echo "${2} Database is DOWN" exit $STATE_CRITICAL --- plugins-scripts/subst.in.orig Mon Mar 18 00:15:04 2002 +++ plugins-scripts/subst.in Tue Jun 4 20:56:09 2002 @@ -29,7 +29,7 @@ return "\"" led3 "/libexec\" " ; } - return led1; + return "\"" led1 "\""; } BEGIN { --- plugins-scripts/utils.sh.in.orig Thu Feb 28 01:43:00 2002 +++ plugins-scripts/utils.sh.in Tue Jun 4 20:56:09 2002 @@ -1,10 +1,10 @@ #! /bin/sh -STATE_DEPENDENT=-2 -STATE_UNKNOWN=-1 STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 +STATE_UNKNOWN=3 +STATE_DEPENDENT=4 if test -x /usr/bin/printf; then ECHO=/usr/bin/printf @@ -19,4 +19,4 @@ support() { $ECHO "@SUPPORT@" | /bin/sed -e 's/\n/ /g' -} \ No newline at end of file +} --- plugins/check_disk.c.orig Wed Jun 5 11:18:38 2002 +++ plugins/check_disk.c Wed Jun 5 12:23:56 2002 @@ -51,6 +51,7 @@ float c_dfp = -1.0; char *path = NULL; int verbose = FALSE; +int display_mntp = FALSE; int main (int argc, char **argv) @@ -64,6 +65,7 @@ char *command_line = NULL; char input_buffer[MAX_INPUT_BUFFER] = ""; char file_system[MAX_INPUT_BUFFER] = ""; + char mntp[MAX_INPUT_BUFFER] = ""; char outbuf[MAX_INPUT_BUFFER] = ""; char *output = NULL; @@ -92,15 +94,15 @@ continue; if (sscanf - (input_buffer, "%s %d %d %d %d%%", file_system, &total_disk, - &used_disk, &free_disk, &usp) == 5 - || sscanf (input_buffer, "%s %*s %d %d %d %d%%", file_system, - &total_disk, &used_disk, &free_disk, &usp) == 5) { + (input_buffer, "%s %d %d %d %d%% %s", file_system, &total_disk, + &used_disk, &free_disk, &usp, &mntp) == 6 + || sscanf (input_buffer, "%s %*s %d %d %d %d%% %s", file_system, + &total_disk, &used_disk, &free_disk, &usp, &mntp) == 6) { result = max (result, check_disk (usp, free_disk)); len = snprintf (outbuf, MAX_INPUT_BUFFER - 1, " [%d kB (%d%%) free on %s]", free_disk, 100 - usp, - file_system); + display_mntp ? mntp : file_system); outbuf[len] = 0; output = strscat (output, outbuf); } @@ -121,8 +123,8 @@ if (spclose (child_process)) result = max (result, STATE_WARNING); - else if (usp < 0) - printf ("Disk %s not mounted or nonexistant\n", argv[3]); + if (usp < 0) + printf ("Disk \"%s\" not mounted or nonexistant\n", path); else if (result == STATE_UNKNOWN) printf ("Unable to read output\n%s\n%s\n", command_line, input_buffer); else @@ -183,6 +185,7 @@ {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, {"help", no_argument, 0, 'h'}, + {"mountpoint", no_argument, 0, 'm'}, {0, 0, 0, 0} }; #endif @@ -190,9 +193,9 @@ while (1) { #ifdef HAVE_GETOPT_H c = - getopt_long (argc, argv, "+?Vhvt:c:w:p:", long_options, &option_index); + getopt_long (argc, argv, "+?Vhvt:c:w:p:m", long_options, &option_index); #else - c = getopt (argc, argv, "+?Vhvt:c:w:p:"); + c = getopt (argc, argv, "+?Vhvt:c:w:p:m"); #endif i++; @@ -255,6 +258,9 @@ case 'v': /* verbose */ verbose = TRUE; break; + case 'm': /* display mountpoint */ + display_mntp = TRUE; + break; case 'V': /* version */ print_revision (my_basename (argv[0]), "$Revision: 1.1.1.1 $"); exit (STATE_OK); @@ -335,6 +341,8 @@ " Exit with CRITCAL status if more than PERCENT of disk space is free\n" " -p, --path=PATH, --partition=PARTTION\n" " Path or partition (checks all mounted partitions if unspecified)\n" + " -m, --mountpoint\n" + " Display the mountpoint instead of the partition\n" " -v, --verbose\n" " Show details for command-line debugging (do not use with nagios server)\n" " -h, --help\n" @@ -347,7 +355,7 @@ print_usage (void) { printf - ("Usage: %s -w limit -c limit [-p path] [-t timeout] [--verbose]\n" + ("Usage: %s -w limit -c limit [-p path] [-t timeout] [-m] [--verbose]\n" " %s (-h|--help)\n" " %s (-V|--version)\n", PROGNAME, PROGNAME, PROGNAME); } From sghosh at sghosh.org Wed Jun 5 10:46:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Jun 5 10:46:02 2002 Subject: [Nagiosplug-devel] Patches to Plugins In-Reply-To: <41BE560FEB5CD411AB0100D0B784C03901F49C88@exc004gptccsge.cfs.capital.ge.com> Message-ID: Thanks - came in cleanly.. BTW: if you get a chance to look at creating a patch for the vsprintf in utils.c ... check_nt fails on solaris at the moment.. -sg On Wed, 5 Jun 2002, Bertelson, Tom (CAP, CARD) wrote: > Here are some patches I came up with to get the plugins working for my > Solaris environment. They should work for other platforms, too. > > configure.in: ntpdc may be called xntpdc > check_flexlm: Gracefully fail if lmstat not found > check_log: Work more like contrib/check_log2. WARNING: This may not be > backward compatible with the original check_log. > check_ntp: Work even if ntpdc not found > check_oracle: Add test for Oracle names server, can dynamically determine > ORACLE_HOME > subst: Can mess up substitutions > utils.sh: Not POSIXLY_CORRECT > check_disk: Add flag to display mount points instead of partitions, > produce > output even if df has errrors > > (I hope !#%!@* Outlook doesn't mangle this too badly) > Enjoy! > From jkoyle at lineo.com Fri Jun 7 15:13:01 2002 From: jkoyle at lineo.com (John Koyle) Date: Fri Jun 7 15:13:01 2002 Subject: [Nagiosplug-devel] check_ntp patch Message-ID: <3D012FBF.1060701@lineo.com> The latest version in CVS needs this simple patch: [root at shire plugins]# diff -uNr check_ntp.orig check_ntp --- check_ntp.orig Fri Jun 7 16:02:01 2002 +++ check_ntp Fri Jun 7 16:02:34 2002 @@ -112,6 +112,7 @@ my $answer = undef; my $offset = undef; +my $have_ntpdc = undef; my $msg; # first line of output to print if format is invalid my $state = $ERRORS{'UNKNOWN'}; @@ -121,9 +122,9 @@ my $key = undef; # some systems don't have a proper ntpdc/xntpdc if ($utils::PATH_TO_NTPDC && -x $utils::PATH_TO_NTPDC ) { - my $have_ntpdc = 1; + $have_ntpdc = 1; }else{ - my $have_ntpdc = 0; + $have_ntpdc = 0; } # Just in case of problems, let's not hang Nagios Thanks, John From sghosh at sghosh.org Fri Jun 7 17:35:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Fri Jun 7 17:35:02 2002 Subject: [Nagiosplug-devel] check_ntp patch In-Reply-To: <3D012FBF.1060701@lineo.com> Message-ID: Thanks - patch is in. -sg On Fri, 7 Jun 2002, John Koyle wrote: > The latest version in CVS needs this simple patch: > > [root at shire plugins]# diff -uNr check_ntp.orig check_ntp > --- check_ntp.orig Fri Jun 7 16:02:01 2002 > +++ check_ntp Fri Jun 7 16:02:34 2002 > @@ -112,6 +112,7 @@ > > my $answer = undef; > my $offset = undef; > +my $have_ntpdc = undef; > my $msg; # first line of output to print if format is invalid > > my $state = $ERRORS{'UNKNOWN'}; > @@ -121,9 +122,9 @@ > my $key = undef; > # some systems don't have a proper ntpdc/xntpdc > if ($utils::PATH_TO_NTPDC && -x $utils::PATH_TO_NTPDC ) { > - my $have_ntpdc = 1; > + $have_ntpdc = 1; > }else{ > - my $have_ntpdc = 0; > + $have_ntpdc = 0; > } > > # Just in case of problems, let's not hang Nagios > > > Thanks, > John > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > From karl.ewald at ixos.de Sun Jun 9 12:12:43 2002 From: karl.ewald at ixos.de (Karl Ewald) Date: Sun Jun 9 12:12:43 2002 Subject: [Nagiosplug-devel] patch for check_smtp.c Message-ID: <077097E85A6BD3119E910800062786A90512DA82@muc-mail5.ixos.de> Hi plugin developers, sendmail will create a syslog entry when a session only issues a quit command, looking roughly like this: Jun 9 19:50:44 beaulieu.ixos.de sendmail[26790]: NOQUEUE: mucnm01.ixos.de [149. 235.38.10] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA This clobbers the syslog of every machine where SMTP is checked and can be prevented by issuing a command. Thze following patch does just that. It is a diff against the netsaint-plugins-1.2.9-4 plugins/check_smtp.c file (which I checked in locally as 1.1). Apologies if this change was already made in the latest release of the plugins, I haven't checked. Have fun, Karl Ewald Network Administrator, IT Services IXOS Software AG http://www.ixos.com/ RCS file: check_smtp.c,v retrieving revision 1.1 diff -u -r1.1 check_smtp.c --- check_smtp.c 2002/06/09 17:21:38 1.1 +++ check_smtp.c 2002/06/09 17:31:48 @@ -43,6 +43,13 @@ #define SMTP_PORT 25 #define SMTP_EXPECT "220" +/* sendmail will syslog a "NOQUEUE" error if session does not attempt + * to do something useful. This can be prevented by giving a command + * even if syntax is illegal (MAIL requires a FROM:<...> argument) + * You can disable sending DUMMYCMD by undefining SMTP_USE_DUMMYCMD. + */ +#define SMTP_DUMMYCMD "MAIL\n" +#define SMTP_USE_DUMMYCMD 1 #define SMTP_QUIT "QUIT\n" int process_arguments(int, char **); @@ -124,6 +131,11 @@ } /* close the connection */ +#ifdef SMTP_USE_DUMMYCMD + send(sd,SMTP_DUMMYCMD,strlen(SMTP_DUMMYCMD),0); + /* allow for response to DUMMYCMD to reach us */ + recv(sd,buffer,MAX_INPUT_BUFFER-1,0); +#endif /* SMTP_USE_DUMMYCMD */ send(sd,SMTP_QUIT,strlen(SMTP_QUIT),0); close(sd); } From mark at netfx.deeptech.com.au Sun Jun 9 19:22:02 2002 From: mark at netfx.deeptech.com.au (mark at netfx.deeptech.com.au) Date: Sun Jun 9 19:22:02 2002 Subject: [Nagiosplug-devel] NSClient CollectData Failed Message-ID: In using NSClient 0.6 or 0.7 I have and increasing number of windows 2000 servers producing perfdata errors and NSClient reporting a CollectData failed error. These machines run Exchange 2000 and PCAnywhere and these services tend to produce similar Perfdata errors only while running NSClient. I have looked for clues to this problem but I have found very little and any insight is appreciated. -- I am Pentium of Borg, division is futile, you will be approximated. From sghosh at sghosh.org Sun Jun 9 20:25:04 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Sun Jun 9 20:25:04 2002 Subject: [Nagiosplug-devel] patch for check_smtp.c In-Reply-To: <077097E85A6BD3119E910800062786A90512DA82@muc-mail5.ixos.de> Message-ID: Thanks - patch is in.. -sg On Sun, 9 Jun 2002, Karl Ewald wrote: > Hi plugin developers, > > sendmail will create a syslog entry when a session only issues a quit > command, looking roughly like this: > Jun 9 19:50:44 beaulieu.ixos.de sendmail[26790]: NOQUEUE: mucnm01.ixos.de > [149. > 235.38.10] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA > > This clobbers the syslog of every machine where SMTP is checked and can be > prevented by issuing a command. Thze following patch does just that. > It is a diff against the netsaint-plugins-1.2.9-4 plugins/check_smtp.c file > (which I checked in locally as 1.1). > Apologies if this change was already made in the latest release of the > plugins, I haven't checked. > > Have fun, > > Karl Ewald > Network Administrator, IT Services > IXOS Software AG http://www.ixos.com/ > > RCS file: check_smtp.c,v > retrieving revision 1.1 > diff -u -r1.1 check_smtp.c > --- check_smtp.c 2002/06/09 17:21:38 1.1 > +++ check_smtp.c 2002/06/09 17:31:48 > @@ -43,6 +43,13 @@ > > #define SMTP_PORT 25 > #define SMTP_EXPECT "220" > +/* sendmail will syslog a "NOQUEUE" error if session does not attempt > + * to do something useful. This can be prevented by giving a command > + * even if syntax is illegal (MAIL requires a FROM:<...> argument) > + * You can disable sending DUMMYCMD by undefining SMTP_USE_DUMMYCMD. > + */ > +#define SMTP_DUMMYCMD "MAIL\n" > +#define SMTP_USE_DUMMYCMD 1 > #define SMTP_QUIT "QUIT\n" > > int process_arguments(int, char **); > @@ -124,6 +131,11 @@ > } > > /* close the connection */ > +#ifdef SMTP_USE_DUMMYCMD > + send(sd,SMTP_DUMMYCMD,strlen(SMTP_DUMMYCMD),0); > + /* allow for response to DUMMYCMD to reach us */ > + recv(sd,buffer,MAX_INPUT_BUFFER-1,0); > +#endif /* SMTP_USE_DUMMYCMD */ > send(sd,SMTP_QUIT,strlen(SMTP_QUIT),0); > close(sd); > } > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > From Tom.Bertelson at gecapital.com Tue Jun 11 10:51:12 2002 From: Tom.Bertelson at gecapital.com (Bertelson, Tom (CAP, CARD)) Date: Tue Jun 11 10:51:12 2002 Subject: [Nagiosplug-devel] Regular expression patch to plugins/check_procs.c Message-ID: <41BE560FEB5CD411AB0100D0B784C03901F49CA5@exc004gptccsge.cfs.capital.ge.com> This patch adds -r and -R flags to check_procs. This makes comparisons with the -a and -C options match as regular expressions. Tested with Solaris; feedback is welcomed. <> -- Tom Bertelson "Any sufficient advanced technlogy GE Card Services is indistinguishable from magic." Tom.Bertelson at gecapital.com -- Arthur C. Clarke <> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mess.txt URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mess.txt URL: From sghosh at sghosh.org Tue Jun 11 16:08:05 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Tue Jun 11 16:08:05 2002 Subject: [Nagiosplug-devel] RE: [Nagios-users] Check_Ping not working on RH7.3 1.0b2 or 1.0b3 In-Reply-To: <000601c2118a$91faffa0$0900a8c0@daml.org> Message-ID: I have no problems running on RH 7.2 my autoconf and autoheader are v2.13 and automake is 1.4-p5 autoheader should create plugins/config.h.in -sg On Tue, 11 Jun 2002, Brandon Amundson wrote: > Subhendu, > > I went into CVS and checkout the nagiosplugs dir and all sub dirs. When > attempting to run automake (after autoconf and autoheader) I got the > following errors; Any ideas what I am doing wrong? Is it because the > config.h.in file is missing from the plugins dir? > > [root at backup nagiosplug]# automake > configure.in: 8: required file `plugins/config.h.in' not found > > Backslash found where operator expected at (eval 863) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 863) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 863) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 864) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 864) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 864) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 865) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 865) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 865) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 866) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 866) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 866) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 867) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 867) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 867) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 868) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 868) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 868) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 869) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 869) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 869) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 870) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 870) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 870) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 871) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 871) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 871) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 872) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 872) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 872) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 873) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 873) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 873) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 874) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 874) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 874) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 875) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 875) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 875) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 876) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 876) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 876) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 877) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 877) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 877) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 878) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 878) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 878) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 879) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 879) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 879) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 880) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 880) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 880) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 881) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 881) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 881) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 882) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 882) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 882) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 883) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 883) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 883) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 884) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 884) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 884) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 885) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 885) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 885) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 886) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 886) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 886) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 887) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 887) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 887) line 1, near "@/_" > (Missing operator before _?) > plugins/Makefile.am: __OBJECTS should not be defined > plugins/Makefile.am: variable `LDADD' not defined > Backslash found where operator expected at (eval 988) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 988) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 988) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 989) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 989) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 989) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 990) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 990) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 990) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 991) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 991) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 991) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 992) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 992) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 992) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 993) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 993) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 993) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 994) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 994) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 994) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 995) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 995) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 995) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 996) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 996) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 996) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 997) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 997) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 997) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 998) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 998) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 998) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 999) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 999) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 999) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1000) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1000) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1000) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1001) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1001) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1001) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1002) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1002) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1002) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1003) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1003) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1003) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1004) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1004) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1004) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1005) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1005) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1005) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1006) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1006) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1006) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1007) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1007) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1007) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1008) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1008) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1008) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1009) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1009) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1009) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1010) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1010) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1010) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1011) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1011) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1011) line 1, near "@/_" > (Missing operator before _?) > Backslash found where operator expected at (eval 1012) line 1, near > "s/\@PROGRAM\@/\/go;s/\" Backslash found where operator expected at > (eval 1012) line 1, near "@XPROGRAM\" > (Missing operator before \?) > Bareword found where operator expected at (eval 1012) line 1, near "@/_" > (Missing operator before _?) > plugins/Makefile.am:99: invalid unused variable name: > `check_ping_DEPENDENCIES' > plugins/Makefile.am:115: invalid unused variable name: > `urlize_DEPENDENCIES' > plugins/Makefile.am:55: invalid unused variable name: `check_nntp_LDADD' > plugins/Makefile.am:101: invalid unused variable name: > `check_procs_DEPENDENCIES' > plugins/Makefile.am:75: invalid unused variable name: > `check_by_ssh_LDADD' > plugins/Makefile.am:72: invalid unused variable name: `check_ups_LDADD' > plugins/Makefile.am:68: invalid unused variable name: `check_swap_LDADD' > plugins/Makefile.am:48: invalid unused variable name: `check_imap_LDADD' > plugins/Makefile.am:62: invalid unused variable name: > `check_procs_LDADD' > plugins/Makefile.am:97: invalid unused variable name: > `check_overcr_DEPENDENCIES' > plugins/Makefile.am:114: invalid unused variable name: > `check_by_ssh_DEPENDENCIES' > plugins/Makefile.am:56: invalid unused variable name: `check_nt_LDADD' > plugins/Makefile.am:94: invalid unused variable name: > `check_nntp_DEPENDENCIES' > plugins/Makefile.am:64: invalid unused variable name: `check_real_LDADD' > plugins/Makefile.am:100: invalid unused variable name: > `check_pop_DEPENDENCIES' > plugins/Makefile.am:112: invalid unused variable name: > `check_users_DEPENDENCIES' > plugins/Makefile.am:109: invalid unused variable name: > `check_time_DEPENDENCIES' > plugins/Makefile.am:108: invalid unused variable name: > `check_tcp_DEPENDENCIES' > plugins/Makefile.am:49: invalid unused variable name: `check_ldap_LDADD' > plugins/Makefile.am:87: invalid unused variable name: > `check_imap_DEPENDENCIES' > plugins/Makefile.am:50: invalid unused variable name: `check_load_LDADD' > plugins/Makefile.am:43: invalid unused variable name: > `check_fping_LDADD' > plugins/Makefile.am:96: invalid unused variable name: > `check_nwstat_DEPENDENCIES' > plugins/Makefile.am:67: invalid unused variable name: `check_ssh_LDADD' > plugins/Makefile.am:39: invalid unused variable name: `check_dig_LDADD' > plugins/Makefile.am:105: invalid unused variable name: > `check_smtp_DEPENDENCIES' > plugins/Makefile.am:82: invalid unused variable name: > `check_fping_DEPENDENCIES' > plugins/Makefile.am:89: invalid unused variable name: > `check_load_DEPENDENCIES' > plugins/Makefile.am:76: invalid unused variable name: `urlize_LDADD' > plugins/Makefile.am:70: invalid unused variable name: `check_time_LDADD' > plugins/Makefile.am:78: invalid unused variable name: > `check_dig_DEPENDENCIES' > plugins/Makefile.am:95: invalid unused variable name: > `check_nt_DEPENDENCIES' > plugins/Makefile.am:90: invalid unused variable name: > `check_mrtg_DEPENDENCIES' > plugins/Makefile.am:110: invalid unused variable name: > `check_udp_DEPENDENCIES' > plugins/Makefile.am:45: invalid unused variable name: `check_game_LDADD' > plugins/Makefile.am:80: invalid unused variable name: > `check_dns_DEPENDENCIES' > plugins/Makefile.am:107: invalid unused variable name: > `check_swap_DEPENDENCIES' > plugins/Makefile.am:54: invalid unused variable name: > `check_nagios_LDADD' > plugins/Makefile.am:113: invalid unused variable name: > `check_vsz_DEPENDENCIES' > plugins/Makefile.am:91: invalid unused variable name: > `check_mrtgtraf_DEPENDENCIES' > plugins/Makefile.am:58: invalid unused variable name: > `check_overcr_LDADD' > plugins/Makefile.am:60: invalid unused variable name: `check_ping_LDADD' > plugins/Makefile.am:51: invalid unused variable name: `check_mrtg_LDADD' > plugins/Makefile.am:103: invalid unused variable name: > `check_real_DEPENDENCIES' > plugins/Makefile.am:69: invalid unused variable name: `check_tcp_LDADD' > plugins/Makefile.am:106: invalid unused variable name: > `check_ssh_DEPENDENCIES' > plugins/Makefile.am:71: invalid unused variable name: `check_udp_LDADD' > plugins/Makefile.am:93: invalid unused variable name: > `check_nagios_DEPENDENCIES' > plugins/Makefile.am:74: invalid unused variable name: `check_vsz_LDADD' > plugins/Makefile.am:66: invalid unused variable name: `check_smtp_LDADD' > plugins/Makefile.am:57: invalid unused variable name: > `check_nwstat_LDADD' > plugins/Makefile.am:84: invalid unused variable name: > `check_game_DEPENDENCIES' > plugins/Makefile.am:41: invalid unused variable name: `check_dns_LDADD' > plugins/Makefile.am:61: invalid unused variable name: `check_pop_LDADD' > plugins/Makefile.am:52: invalid unused variable name: > `check_mrtgtraf_LDADD' > plugins/Makefile.am:88: invalid unused variable name: > `check_ldap_DEPENDENCIES' > plugins/Makefile.am:73: invalid unused variable name: > `check_users_LDADD' > plugins/Makefile.am:111: invalid unused variable name: > `check_ups_DEPENDENCIES' > > > Brandon > From sghosh at sghosh.org Wed Jun 12 08:19:06 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Jun 12 08:19:06 2002 Subject: [Nagiosplug-devel] Re: [Nagios-users] Nagios Plugins In-Reply-To: <004501c21221$5f6069d0$0900a8c0@daml.org> Message-ID: Morning Brandon what OS and what versions of autoconf? see if you can run with autconf 2.13 -sg On Wed, 12 Jun 2002, Brandon Amundson wrote: > Good Morning, > > I am having a problem getting the nagios plugins to a state where I can > compile them. Let me explain. I checked out the nagiosplug dir from cvs > and read the README and INSTALL. I ran autoconf, and then autoheader. > Autoheader gave me the following errors: > > [root at backup nagiosplug]# autoheader > WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot' > WARNING: and `config.h.top', to define templates for `config.h.in' > WARNING: is deprecated and discouraged. > > WARNING: Using the third argument of `AC_DEFINE' and > WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without > WARNING: `acconfig.h': > > WARNING: AC_DEFINE([NEED_MAIN], 1, > WARNING: [Define if a function `main' is needed.]) > > WARNING: More sophisticated templates can also be produced, see the > WARNING: documentation. > autoheader: `plugins/config.h.in' is created > > Just warnings so I continued. Automake gave me the following errors: > > [root at backup nagiosplug]# automake > automake: configure.in: `AM_INIT_AUTOMAKE' must be used > automake: configure.in: required file `./depcomp' not found > /usr/share/automake-1.5/am/depend2.am: AMDEP does not appear in > AM_CONDITIONAL > /usr/share/automake-1.5/am/depend2.am: AMDEP does not appear in > AM_CONDITIONAL > /usr/share/automake-1.5/am/depend2.am: AMDEP does not appear in > AM_CONDITIONAL > /usr/share/automake-1.5/am/lang-compile.am: AMDEP does not appear in > AM_CONDITIONAL > plugins/Makefile.am:99: invalid unused variable name: > `check_ping_DEPENDENCIES' > plugins/Makefile.am:115: invalid unused variable name: > `urlize_DEPENDENCIES' > plugins/Makefile.am:55: invalid unused variable name: `check_nntp_LDADD' > plugins/Makefile.am:101: invalid unused variable name: > `check_procs_DEPENDENCIES' > plugins/Makefile.am:75: invalid unused variable name: > `check_by_ssh_LDADD' > plugins/Makefile.am:72: invalid unused variable name: `check_ups_LDADD' > plugins/Makefile.am:68: invalid unused variable name: `check_swap_LDADD' > plugins/Makefile.am:48: invalid unused variable name: `check_imap_LDADD' > plugins/Makefile.am:62: invalid unused variable name: > `check_procs_LDADD' > plugins/Makefile.am:97: invalid unused variable name: > `check_overcr_DEPENDENCIES' > plugins/Makefile.am:114: invalid unused variable name: > `check_by_ssh_DEPENDENCIES' > plugins/Makefile.am:56: invalid unused variable name: `check_nt_LDADD' > plugins/Makefile.am:94: invalid unused variable name: > `check_nntp_DEPENDENCIES' > plugins/Makefile.am:64: invalid unused variable name: `check_real_LDADD' > plugins/Makefile.am:100: invalid unused variable name: > `check_pop_DEPENDENCIES' > plugins/Makefile.am:112: invalid unused variable name: > `check_users_DEPENDENCIES' > plugins/Makefile.am:109: invalid unused variable name: > `check_time_DEPENDENCIES' > plugins/Makefile.am:108: invalid unused variable name: > `check_tcp_DEPENDENCIES' > plugins/Makefile.am:49: invalid unused variable name: `check_ldap_LDADD' > plugins/Makefile.am:87: invalid unused variable name: > `check_imap_DEPENDENCIES' > plugins/Makefile.am:50: invalid unused variable name: `check_load_LDADD' > plugins/Makefile.am:43: invalid unused variable name: > `check_fping_LDADD' > plugins/Makefile.am:96: invalid unused variable name: > `check_nwstat_DEPENDENCIES' > plugins/Makefile.am:67: invalid unused variable name: `check_ssh_LDADD' > plugins/Makefile.am:39: invalid unused variable name: `check_dig_LDADD' > plugins/Makefile.am:105: invalid unused variable name: > `check_smtp_DEPENDENCIES' > plugins/Makefile.am:82: invalid unused variable name: > `check_fping_DEPENDENCIES' > plugins/Makefile.am:89: invalid unused variable name: > `check_load_DEPENDENCIES' > plugins/Makefile.am:76: invalid unused variable name: `urlize_LDADD' > plugins/Makefile.am:70: invalid unused variable name: `check_time_LDADD' > plugins/Makefile.am:78: invalid unused variable name: > `check_dig_DEPENDENCIES' > plugins/Makefile.am:95: invalid unused variable name: > `check_nt_DEPENDENCIES' > plugins/Makefile.am:90: invalid unused variable name: > `check_mrtg_DEPENDENCIES' > plugins/Makefile.am:110: invalid unused variable name: > `check_udp_DEPENDENCIES' > plugins/Makefile.am:45: invalid unused variable name: `check_game_LDADD' > plugins/Makefile.am:80: invalid unused variable name: > `check_dns_DEPENDENCIES' > plugins/Makefile.am:107: invalid unused variable name: > `check_swap_DEPENDENCIES' > plugins/Makefile.am:54: invalid unused variable name: > `check_nagios_LDADD' > plugins/Makefile.am:113: invalid unused variable name: > `check_vsz_DEPENDENCIES' > plugins/Makefile.am:91: invalid unused variable name: > `check_mrtgtraf_DEPENDENCIES' > plugins/Makefile.am:58: invalid unused variable name: > `check_overcr_LDADD' > plugins/Makefile.am:60: invalid unused variable name: `check_ping_LDADD' > plugins/Makefile.am:51: invalid unused variable name: `check_mrtg_LDADD' > plugins/Makefile.am:103: invalid unused variable name: > `check_real_DEPENDENCIES' > plugins/Makefile.am:69: invalid unused variable name: `check_tcp_LDADD' > plugins/Makefile.am:106: invalid unused variable name: > `check_ssh_DEPENDENCIES' > plugins/Makefile.am:71: invalid unused variable name: `check_udp_LDADD' > plugins/Makefile.am:93: invalid unused variable name: > `check_nagios_DEPENDENCIES' > plugins/Makefile.am:74: invalid unused variable name: `check_vsz_LDADD' > plugins/Makefile.am:66: invalid unused variable name: `check_smtp_LDADD' > plugins/Makefile.am:57: invalid unused variable name: > `check_nwstat_LDADD' > plugins/Makefile.am:84: invalid unused variable name: > `check_game_DEPENDENCIES' > plugins/Makefile.am:41: invalid unused variable name: `check_dns_LDADD' > plugins/Makefile.am:61: invalid unused variable name: `check_pop_LDADD' > plugins/Makefile.am:52: invalid unused variable name: > `check_mrtgtraf_LDADD' > plugins/Makefile.am:88: invalid unused variable name: > `check_ldap_DEPENDENCIES' > plugins/Makefile.am:73: invalid unused variable name: > `check_users_LDADD' > plugins/Makefile.am:111: invalid unused variable name: > `check_ups_DEPENDENCIES' > > Any Idea what is causing this? > > Brandon Amundson > BBN Technologies > LAB: 703 284 8189 > bamundson at bbn.com > > > _______________________________________________________________ > > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Nagios-users mailing list > Nagios-users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagios-users > From ben.madsen at attbi.com Thu Jun 13 12:04:07 2002 From: ben.madsen at attbi.com (Benjamin Madsen) Date: Thu Jun 13 12:04:07 2002 Subject: [Nagiosplug-devel] Recent patch to check_smtp.c Message-ID: <5.1.0.14.0.20020613115747.05209dc8@mail.attbi.com> Running the recent patch against a Microsoft 2000 Server w/ Exchange SMTP agent caused problems with the SMTP_DUMMYCMD check. Apparently, Exchange's SMTP agent looks for a '\r\n' as opposed to just a '\n'. Since I am unfamiliar with how to patch things, could somebody do that? Also, I'm wondering what implications changing the SMTP_DUMMCMD to "MAIL\r\n" would be... Any ideas? Thanks, Ben Madsen IT Manager Wisp Communications http://www.wispcommunications.com --- Original Message --- FROM: Karl Ewald DATE: 06/09/2002 12:12:36 SUBJECT: [Nagiosplug-devel] patch for check_smtp.c Hi plugin developers, sendmail will create a syslog entry when a session only issues a quit command, looking roughly like this: Jun 9 19:50:44 beaulieu.ixos.de sendmail[26790]: NOQUEUE: mucnm01.ixos.de [149. 235.38.10] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA This clobbers the syslog of every machine where SMTP is checked and can be prevented by issuing a command. Thze following patch does just that. It is a diff against the netsaint-plugins-1.2.9-4 plugins/check_smtp.c file (which I checked in locally as 1.1). Apologies if this change was already made in the latest release of the plugins, I haven't checked. Have fun, Karl Ewald Network Administrator, IT Services IXOS Software AG http://www.ixos.com/ From sghosh at sghosh.org Thu Jun 13 12:57:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Thu Jun 13 12:57:02 2002 Subject: [Nagiosplug-devel] Recent patch to check_smtp.c In-Reply-To: <5.1.0.14.0.20020613115747.05209dc8@mail.attbi.com> Message-ID: I guess one could add a regex to see if the initial 220 response matches some thing unique to Exchange.. Could you post a 220 response from an Exchange server - I am happily ignorant on that issue :) Also if this is causing you problems right now - just change the SMTP_USE_DUMMYCMD to 0.. -sg On Thu, 13 Jun 2002, Benjamin Madsen wrote: > Running the recent patch against a Microsoft 2000 Server w/ Exchange SMTP > agent caused problems with the SMTP_DUMMYCMD check. Apparently, Exchange's > SMTP agent looks for a '\r\n' as opposed to just a '\n'. Since I am > unfamiliar with how to patch things, could somebody do that? > > Also, I'm wondering what implications changing the SMTP_DUMMCMD to > "MAIL\r\n" would be... Any ideas? > > Thanks, > Ben Madsen > IT Manager > Wisp Communications > http://www.wispcommunications.com > > --- Original Message --- > FROM: Karl Ewald > DATE: 06/09/2002 12:12:36 > SUBJECT: [Nagiosplug-devel] patch for check_smtp.c > Hi plugin developers, > > sendmail will create a syslog entry when a session only issues a quit > command, looking roughly like this: > Jun 9 19:50:44 beaulieu.ixos.de sendmail[26790]: NOQUEUE: mucnm01.ixos.de > [149. > 235.38.10] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA > > This clobbers the syslog of every machine where SMTP is checked and can be > prevented by issuing a command. Thze following patch does just that. > It is a diff against the netsaint-plugins-1.2.9-4 plugins/check_smtp.c file > (which I checked in locally as 1.1). > Apologies if this change was already made in the latest release of the > plugins, I haven't checked. > > Have fun, > > Karl Ewald > Network Administrator, IT Services > IXOS Software AG http://www.ixos.com/ > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > From Tom.Bertelson at gecapital.com Thu Jun 13 13:10:04 2002 From: Tom.Bertelson at gecapital.com (Bertelson, Tom (CAP, CARD)) Date: Thu Jun 13 13:10:04 2002 Subject: [Nagiosplug-devel] Recent patch to check_smtp.c Message-ID: <41BE560FEB5CD411AB0100D0B784C03901F49CC4@exc004gptccsge.cfs.capital.ge.com> The SMTP protocol says (RFC 821): 4.1.1. COMMAND SEMANTICS The SMTP commands define the mail transfer or the mail system function requested by the user. SMTP commands are character strings terminated by . The command codes themselves are alphabetic characters terminated by if parameters follow and otherwise. The syntax of mailboxes must conform to receiver site conventions. The SMTP commands are discussed below. The SMTP replies are discussed in the Section 4.2. I've never encountered a system that cannot handle \r\n. -- Tom Bertelson "Any sufficient advanced technlogy GE Card Services is indistinguishable from magic." Tom.Bertelson at gecapital.com -- Arthur C. Clarke -----Original Message----- From: Subhendu Ghosh [mailto:sghosh at sghosh.org] Sent: Thursday, June 13, 2002 3:56 PM To: nagiosplug-devel at lists.sourceforge.net Subject: Re: [Nagiosplug-devel] Recent patch to check_smtp.c I guess one could add a regex to see if the initial 220 response matches some thing unique to Exchange.. Could you post a 220 response from an Exchange server - I am happily ignorant on that issue :) Also if this is causing you problems right now - just change the SMTP_USE_DUMMYCMD to 0.. -sg On Thu, 13 Jun 2002, Benjamin Madsen wrote: > Running the recent patch against a Microsoft 2000 Server w/ Exchange SMTP > agent caused problems with the SMTP_DUMMYCMD check. Apparently, Exchange's > SMTP agent looks for a '\r\n' as opposed to just a '\n'. Since I am > unfamiliar with how to patch things, could somebody do that? > > Also, I'm wondering what implications changing the SMTP_DUMMCMD to > "MAIL\r\n" would be... Any ideas? > > Thanks, > Ben Madsen > IT Manager > Wisp Communications > http://www.wispcommunications.com > > --- Original Message --- > FROM: Karl Ewald > DATE: 06/09/2002 12:12:36 > SUBJECT: [Nagiosplug-devel] patch for check_smtp.c > Hi plugin developers, > > sendmail will create a syslog entry when a session only issues a quit > command, looking roughly like this: > Jun 9 19:50:44 beaulieu.ixos.de sendmail[26790]: NOQUEUE: mucnm01.ixos.de > [149. > 235.38.10] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA > > This clobbers the syslog of every machine where SMTP is checked and can be > prevented by issuing a command. Thze following patch does just that. > It is a diff against the netsaint-plugins-1.2.9-4 plugins/check_smtp.c file > (which I checked in locally as 1.1). > Apologies if this change was already made in the latest release of the > plugins, I haven't checked. > > Have fun, > > Karl Ewald > Network Administrator, IT Services > IXOS Software AG http://www.ixos.com/ > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Nagiosplug-devel mailing list Nagiosplug-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel From sghosh at sghosh.org Thu Jun 13 13:20:08 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Thu Jun 13 13:20:08 2002 Subject: [Nagiosplug-devel] Recent patch to check_smtp.c In-Reply-To: <41BE560FEB5CD411AB0100D0B784C03901F49CC4@exc004gptccsge.cfs.capital.ge.com> Message-ID: OK - I stand corrected, will put in a patch for \r\n into cvs.. -sg On Thu, 13 Jun 2002, Bertelson, Tom (CAP, CARD) wrote: > The SMTP protocol says (RFC 821): > > 4.1.1. COMMAND SEMANTICS > > The SMTP commands define the mail transfer or the mail system > function requested by the user. SMTP commands are character > strings terminated by . The command codes themselves are > alphabetic characters terminated by if parameters follow > and otherwise. The syntax of mailboxes must conform to > receiver site conventions. The SMTP commands are discussed > below. The SMTP replies are discussed in the Section 4.2. > > I've never encountered a system that cannot handle \r\n. > From benmadsenx at attbi.com Thu Jun 13 13:30:01 2002 From: benmadsenx at attbi.com (Benjamin Madsen) Date: Thu Jun 13 13:30:01 2002 Subject: [Nagiosplug-devel] Recent patch to check_smtp.c In-Reply-To: <41BE560FEB5CD411AB0100D0B784C03901F49CC4@exc004gptccsge.cf s.capital.ge.com> Message-ID: <5.1.0.14.0.20020613132305.053bbb30@mail.attbi.com> Thank you Tom, I need to learn to check the RFC's for this stuff more often. The attached patch will change the SMTP_DUMMYCMD to use \r\n to terminate the command to more closely follow RFC 821. -Ben At 04:08 PM 6/13/2002 -0400, Tom wrote: >The SMTP protocol says (RFC 821): > > 4.1.1. COMMAND SEMANTICS > > The SMTP commands define the mail transfer or the mail system > function requested by the user. SMTP commands are character > strings terminated by . The command codes themselves are > alphabetic characters terminated by if parameters follow > and otherwise. The syntax of mailboxes must conform to > receiver site conventions. The SMTP commands are discussed > below. The SMTP replies are discussed in the Section 4.2. > >I've never encountered a system that cannot handle \r\n. >-- >Tom Bertelson "Any sufficient advanced technlogy >GE Card Services is indistinguishable from magic." >Tom.Bertelson at gecapital.com -- Arthur C. Clarke --- check_smtp.c Thu Jun 13 13:21:46 2002 +++ check_smtp.c Thu Jun 13 13:26:43 2002 @@ -48,9 +48,9 @@ * even if syntax is illegal (MAIL requires a FROM:<...> argument) * You can disable sending DUMMYCMD by undefining SMTP_USE_DUMMYCMD. */ -#define SMTP_DUMMYCMD "MAIL\n" +#define SMTP_DUMMYCMD "MAIL\r\n" #define SMTP_USE_DUMMYCMD 1 -#define SMTP_QUIT "QUIT\n" +#define SMTP_QUIT "QUIT\r\n" int process_arguments (int, char **); int call_getopt (int, char **); From sghosh at sghosh.org Thu Jun 13 21:31:03 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Thu Jun 13 21:31:03 2002 Subject: [Nagiosplug-devel] check_snmp usage Message-ID: Looking for feedback.. Larry Low recently submitted a patch a on being able to specify what MIBs should be loaded by check_snmp rather than the current ALL setting. I tend to agree that the ALL setting is wasteful in terms of memory specially if you have a lot of mibs lying around like I do (all of cisco, extreme, compaq, + some others) However, I may look for a default that includes the mibs that are part of the net-snmp install - rather than an empty default. Comments on how you use check_snmp - with numeric oids or symbolic oids Interested specially in those that use symbolic oids from enterprise mibs.. There are couple other patches pending: for alternate port and for SNMPv3 -sg From Peter.Hicks at POGGS.CO.UK Fri Jun 14 02:42:03 2002 From: Peter.Hicks at POGGS.CO.UK (Peter Hicks) Date: Fri Jun 14 02:42:03 2002 Subject: [Nagiosplug-devel] Re: [Netsaintplug-devel] check_snmp usage References: Message-ID: <3D09BA52.2010706@POGGS.CO.UK> Hi Subhendu I have loads of custom-written plugins. check_snmp will read system.sysUpTime.0 and check that this is a value, and check_ will check that all is well with a particular hardware platform, e.g. a Compaq server. I use numeric OIDs, sysUpTime.0 isn't likely to change OID anytime soon :) Peter. Subhendu Ghosh wrote: >Looking for feedback.. > >Larry Low recently submitted a patch a on being able to specify what MIBs >should be loaded by check_snmp rather than the current ALL setting. > >I tend to agree that the ALL setting is wasteful in terms of memory >specially if you have a lot of mibs lying around like I do (all of cisco, >extreme, compaq, + some others) > >However, I may look for a default that includes the mibs that are part of >the net-snmp install - rather than an empty default. > > >Comments on how you use check_snmp - with numeric oids or symbolic oids >Interested specially in those that use symbolic oids from enterprise >mibs.. > > >There are couple other patches pending: > for alternate port and for SNMPv3 > > >-sg > > > >_______________________________________________________________ > >Don't miss the 2002 Sprint PCS Application Developer's Conference >August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > >_______________________________________________ >Netsaintplug-devel mailing list >Netsaintplug-devel at lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/netsaintplug-devel > > > From Tom.Bertelson at gecapital.com Fri Jun 14 06:14:06 2002 From: Tom.Bertelson at gecapital.com (Bertelson, Tom (CAP, CARD)) Date: Fri Jun 14 06:14:06 2002 Subject: [Nagiosplug-devel] check_snmp usage Message-ID: <41BE560FEB5CD411AB0100D0B784C03901F49CC6@exc004gptccsge.cfs.capital.ge.com> I recently ran into a problem where my list of symbolic OID's was greater than Nagios' 1024-character buffer size. I'm now using numeric OID's for the "-o" option (to keep the command line short) but have the MIBs installed so the output looks nicer. I think being able to specify the MIBs to load is a good idea. The default should still be "-m ALL", for backward compatability. How about "-m All" if the user specifies no MIBs, and the core net-snmp MIBs plus the user-specified ones otherwise? While we're at it, how about an option to specify the directories to search? -- Tom Bertelson "Any sufficiently advanced technology GE Card Services is indistinguishable from magic." Tom.Bertelson at gecapital.com -- Arthur C. Clarke -----Original Message----- From: Subhendu Ghosh [mailto:sghosh at sghosh.org] Sent: Friday, June 14, 2002 12:30 AM To: NagiosPlug Devel Cc: netsaintplug-devel at lists.sourceforge.net Subject: [Nagiosplug-devel] check_snmp usage Looking for feedback.. Larry Low recently submitted a patch a on being able to specify what MIBs should be loaded by check_snmp rather than the current ALL setting. I tend to agree that the ALL setting is wasteful in terms of memory specially if you have a lot of mibs lying around like I do (all of cisco, extreme, compaq, + some others) However, I may look for a default that includes the mibs that are part of the net-snmp install - rather than an empty default. Comments on how you use check_snmp - with numeric oids or symbolic oids Interested specially in those that use symbolic oids from enterprise mibs.. There are couple other patches pending: for alternate port and for SNMPv3 -sg _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink _______________________________________________ Nagiosplug-devel mailing list Nagiosplug-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel From sghosh at sghosh.org Fri Jun 14 10:37:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Fri Jun 14 10:37:02 2002 Subject: [Nagiosplug-devel] check_snmp usage In-Reply-To: <41BE560FEB5CD411AB0100D0B784C03901F49CC6@exc004gptccsge.cfs.capital.ge.com> Message-ID: On Fri, 14 Jun 2002, Bertelson, Tom (CAP, CARD) wrote: > I recently ran into a problem where my list of symbolic OID's was greater > than Nagios' 1024-character buffer size. I'm now using numeric OID's for > the "-o" option (to keep the command line short) but have the MIBs installed > so the output looks nicer. > > I think being able to specify the MIBs to load is a good idea. The default > should still be "-m ALL", for backward compatability. How about "-m All" if > the user specifies no MIBs, and the core net-snmp MIBs plus the > user-specified ones otherwise? > > While we're at it, how about an option to specify the directories to search? > Directories to search --- would that be better off in snmp.conf? Sprickman was working with putting all the snmpv3 auth info in snmp.conf as well so check_snmp could potentially be called with only host and oid information.. -sg From jkoyle at lineo.com Tue Jun 18 09:45:06 2002 From: jkoyle at lineo.com (John Koyle) Date: Tue Jun 18 09:45:06 2002 Subject: [Nagiosplug-devel] Recent updates Message-ID: <3D0F6384.7070105@lineo.com> I've been using the plugins from CVS on the 7th (when I submitted a smal check_ntp patch) and they've functioned fine. Today I ran a cvs update to get the latest check_smtp patch and rid myself of the annoying messages and the following plugins broke: check_ping, check_disk, check_procs. Reverting the common.h.in changes that were recently made in CVS fixed the problem. It appears that change has wider implecations, or more updates are coming. Thanks, John From sghosh at sghosh.org Tue Jun 18 16:13:07 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Tue Jun 18 16:13:07 2002 Subject: [Nagiosplug-devel] Recent updates In-Reply-To: <3D0F6384.7070105@lineo.com> Message-ID: Oops, mea culpa I really need to go through all the C plugins now... -sg On Tue, 18 Jun 2002, John Koyle wrote: > I've been using the plugins from CVS on the 7th (when I submitted a smal > check_ntp patch) and they've functioned fine. > > Today I ran a cvs update to get the latest check_smtp patch and rid > myself of the annoying messages and the following plugins broke: > check_ping, check_disk, check_procs. > > Reverting the common.h.in changes that were recently made in CVS fixed > the problem. It appears that change has wider implecations, or more > updates are coming. > > Thanks, > John > > > ---------------------------------------------------------------------------- > Bringing you mounds of caffeinated joy > >>> http://thinkgeek.com/sf <<< > > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > -- From sghosh at sghosh.org Tue Jun 18 20:16:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Tue Jun 18 20:16:02 2002 Subject: [Nagiosplug-devel] Recent updates In-Reply-To: Message-ID: Fixes are in for check_ping, check_procs, and check_disk. still to come check_dig, check_fping, check_hpjd, check_nagios, check_snmp, check_vsz, urlize unless someone else gets to them first... :) -sg On Tue, 18 Jun 2002, Subhendu Ghosh wrote: > Oops, mea culpa > > I really need to go through all the C plugins now... > > -sg > > On Tue, 18 Jun 2002, John Koyle wrote: > > > I've been using the plugins from CVS on the 7th (when I submitted a smal > > check_ntp patch) and they've functioned fine. > > > > Today I ran a cvs update to get the latest check_smtp patch and rid > > myself of the annoying messages and the following plugins broke: > > check_ping, check_disk, check_procs. > > > > Reverting the common.h.in changes that were recently made in CVS fixed > > the problem. It appears that change has wider implecations, or more > > updates are coming. > > > > Thanks, > > John > > -- From sghosh at sghosh.org Tue Jun 18 22:27:05 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Tue Jun 18 22:27:05 2002 Subject: [Nagiosplug-devel] Recent updates In-Reply-To: <3D0F6384.7070105@lineo.com> Message-ID: Any feedback related to the CVS changes made today would be useful. -- -sg From karl.ewald at ixos.de Wed Jun 19 12:11:07 2002 From: karl.ewald at ixos.de (Karl Ewald) Date: Wed Jun 19 12:11:07 2002 Subject: [Nagiosplug-devel] Patch for popen.c and check_snmp.c allowing environment to be pas sed Message-ID: <077097E85A6BD3119E910800062786A90512DAC9@muc-mail5.ixos.de> Hi developers, We have found the need to pass an environment variable to the process called by check_snmp (snmpget). In the particular case, this may well be attributed to my stupidity while building ucd-snmp, however I can foresee valid reasons for wanting to pass an environment to a called program. The following patch permits doing this. One could also choose to pass the environment inherited, which would be somewhat more natural, but it was actually beneficial to us to ensure a well-defined state when executing the external program. The definition of CHILD_ENV_ARRAY would probably be better placed in the Makefile, however I didn't want to touch too many files to keep the change tightly contained. My setting can only serve as an example. 1.1 is my own version number for each file as distributed with netsaint-plugins-1.2.9-4 I hope it is of some use to you. ============================================================================ ======== diff -u -r1.1 popen.c --- popen.c 2002/06/19 17:20:31 1.1 +++ popen.c 2002/06/19 18:40:23 @@ -6,6 +6,7 @@ * Provides spopen and spclose FILE * spopen(const char *); +FILE *spopene(const char *,const char *[]); int spclose(FILE *); * @@ -28,6 +29,7 @@ extern FILE *child_process; FILE *spopen(const char *); +FILE *spopene(const char *,const char *[]); int spclose(FILE *); RETSIGTYPE popen_timeout_alarm_handler(int); @@ -67,6 +69,13 @@ FILE *spopen(const char *cmdstring) { char *environ[] = { NULL }; + + return(spopene(cmdstring,environ)); +} + +FILE *spopene(const char *cmdstring, const char *environ[]) +{ + char *cmd=NULL; char **argv=NULL; char *str; ============================================================================ ======== diff -u -r1.1 popen.h --- popen.h 2002/06/19 18:26:48 1.1 +++ popen.h 2002/06/19 18:27:42 @@ -1,5 +1,6 @@ /* plugins/popen.h. Generated automatically by configure. */ FILE *spopen(const char *); +FILE *spopene(const char *,const char *[]); int spclose(FILE *); RETSIGTYPE popen_timeout_alarm_handler(int); ============================================================================ ======== diff -u -r1.1 check_snmp.c --- check_snmp.c 2002/06/19 17:03:20 1.1 +++ check_snmp.c 2002/06/19 19:03:38 @@ -37,6 +37,9 @@ #include "utils.h" #include "popen.h" +/* this should go into the makefile */ +#define CHILD_ENV_ARRAY { "LD_LIBRARY_PATH=/usr/local/lib", NULL } + #define PROGNAME check_snmp #define mark(a) ((a)!=0?"*":"") @@ -132,6 +135,7 @@ char *ptr = NULL; char *p2 = NULL; char *show = NULL; + char *environ[] = CHILD_ENV_ARRAY; labels = malloc(labels_size); unitv = malloc(unitv_size); @@ -156,7 +160,7 @@ } /* run the command */ - child_process = spopen(command_line); + child_process = spopene(command_line,environ); if (child_process == NULL) { printf("Could not open pipe: %s\n", command_line); exit(STATE_UNKNOWN); ============================================================================ ======== Happy merging, Karl Ewald IT Services IXOS Software AG, Bretonischer Ring 12, 85630 Grasbrunn Tel. +49.89.4629.1350, Fax +49.89.4629.331350 From sghosh at sghosh.org Wed Jun 19 12:32:08 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Jun 19 12:32:08 2002 Subject: [Nagiosplug-devel] Patch for popen.c and check_snmp.c allowing environment to be pas sed In-Reply-To: <077097E85A6BD3119E910800062786A90512DAC9@muc-mail5.ixos.de> Message-ID: In this particular case - you should be able to solve the ld issue by editing /etc/ld.so.conf (linux variants) or running crle (solaris) could you post the patch on sourceforge so we can keep track of it. tia. -sg On Wed, 19 Jun 2002, Karl Ewald wrote: > Hi developers, > > We have found the need to pass an environment variable to the process called > by check_snmp (snmpget). In the particular case, this may well be attributed > to my stupidity while building ucd-snmp, however I can foresee valid reasons > for wanting to pass an environment to a called program. The following patch > permits doing this. > > One could also choose to pass the environment inherited, which would be > somewhat more natural, but it was actually beneficial to us to ensure a > well-defined state when executing the external program. The definition of > CHILD_ENV_ARRAY would probably be better placed in the Makefile, however I > didn't want to touch too many files to keep the change tightly contained. My > setting can only serve as an example. > > 1.1 is my own version number for each file as distributed with > netsaint-plugins-1.2.9-4 > > I hope it is of some use to you. > > ============================================================================ > ======== > diff -u -r1.1 popen.c > --- popen.c 2002/06/19 17:20:31 1.1 > +++ popen.c 2002/06/19 18:40:23 > @@ -6,6 +6,7 @@ > * Provides spopen and spclose > > FILE * spopen(const char *); > +FILE *spopene(const char *,const char *[]); > int spclose(FILE *); > > * > @@ -28,6 +29,7 @@ > extern FILE *child_process; > > FILE *spopen(const char *); > +FILE *spopene(const char *,const char *[]); > int spclose(FILE *); > RETSIGTYPE popen_timeout_alarm_handler(int); > > @@ -67,6 +69,13 @@ > FILE *spopen(const char *cmdstring) > { > char *environ[] = { NULL }; > + > + return(spopene(cmdstring,environ)); > +} > + > +FILE *spopene(const char *cmdstring, const char *environ[]) > +{ > + > char *cmd=NULL; > char **argv=NULL; > char *str; > ============================================================================ > ======== > diff -u -r1.1 popen.h > --- popen.h 2002/06/19 18:26:48 1.1 > +++ popen.h 2002/06/19 18:27:42 > @@ -1,5 +1,6 @@ > /* plugins/popen.h. Generated automatically by configure. */ > FILE *spopen(const char *); > +FILE *spopene(const char *,const char *[]); > int spclose(FILE *); > RETSIGTYPE popen_timeout_alarm_handler(int); > > ============================================================================ > ======== > diff -u -r1.1 check_snmp.c > --- check_snmp.c 2002/06/19 17:03:20 1.1 > +++ check_snmp.c 2002/06/19 19:03:38 > @@ -37,6 +37,9 @@ > #include "utils.h" > #include "popen.h" > > +/* this should go into the makefile */ > +#define CHILD_ENV_ARRAY { "LD_LIBRARY_PATH=/usr/local/lib", NULL } > + > #define PROGNAME check_snmp > > #define mark(a) ((a)!=0?"*":"") > @@ -132,6 +135,7 @@ > char *ptr = NULL; > char *p2 = NULL; > char *show = NULL; > + char *environ[] = CHILD_ENV_ARRAY; > > labels = malloc(labels_size); > unitv = malloc(unitv_size); > @@ -156,7 +160,7 @@ > } > > /* run the command */ > - child_process = spopen(command_line); > + child_process = spopene(command_line,environ); > if (child_process == NULL) { > printf("Could not open pipe: %s\n", command_line); > exit(STATE_UNKNOWN); > ============================================================================ > ======== > > Happy merging, > > Karl Ewald > IT Services > IXOS Software AG, Bretonischer Ring 12, 85630 Grasbrunn > Tel. +49.89.4629.1350, Fax +49.89.4629.331350 > > > ---------------------------------------------------------------------------- > Bringing you mounds of caffeinated joy > >>> http://thinkgeek.com/sf <<< > > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > -- From J at fairbankscapital.com Wed Jun 19 18:30:02 2002 From: J at fairbankscapital.com (J. Casalino) Date: Wed Jun 19 18:30:02 2002 Subject: [Nagiosplug-devel] check_disk_smb problem Message-ID: <1B6358FB8E7F9843AB3631A90C330B8501032D@slexchange2.fairbankscapital.com> Greetings. I've been playing with the NetSaint 1.2.9-4 check_disk_smb plugin today. I noticed the following errant behavior in the WARNING and CRITICAL notifications. * If I specify a percentage, the plugin appears to work as designed. As soon as I cross the warning threshold percent specified on the commandline, I receive the warning notification, and as soon as I cross the critical threshold percent, I receive the critical threshold notification. * If I use the M(byte) or G(byte) for warning/critical thresholds, I never receive a warning -- I go straight to critical no matter what the warning threshold is set to. I made some quick modifications to the check_disk_smb plugin to verify my suspicions, since I didn't know any other way to display whether I was exiting the script with a warning or critical state. Watch what happens here (username and password sanitized): Using the default values of warning at 85% and critical at 95% I receive this output: [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u -p Disk ok - 3.3G (29%) free on \\172.16.2.36\log Using the thresholds where I want them, at 70% warning and 90% critical, I receive the following: [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u -p -w70 -c90 WARNING -- Only 3.3G (29%) free on \\172.16.2.36\log Using a threshold for warning at 3500M and critical at 1000M, I get the following: [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u -p -w3500M -c1000M CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log Same result if I use 3G and 1G instead of 3500M and 1000M: [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u -p -w3G -c1G CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log But even more interesting, even if I specify 2G and 1G for warning/critical thresholds respectively, I receive: [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u -p -w2G -c1G CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log I checked the Nagios v1.3 check_disk_smb plugin and it appears that some of the perl was cleaned up, but the logic is largely the same as the NetSaint 1.2.9-4 plugin. If I had any idea where to start with this I would, but I'm not familiar enough with CVS or perl to feel comfortable hacking the logic on this one. In addition, I'd like to suggest two items for check_disk_smb: 1) I think that check_disk_smb *should* also report WARNING -- or CRITICAL -- like the modifications I made above so that it's easier to troubleshoot warning/critical threshold problems. 2) check_disk_smb currently does not support checking administrative or hidden shares on servers such as c$, d$, e$, etc... While I don't want to create a domain admin user just to allow NetSaint/Nagios to check drive space, it would be quite handy to be able to specify a hidden share such as log$ in the example above so users wouldn't be able to see shares they should not have access to. Thanks! J. Casalino Sr. Network Administrator, Fairbanks Capital Corp. josephc at fairbankscapital.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From sghosh at sghosh.org Wed Jun 19 21:30:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Jun 19 21:30:02 2002 Subject: [Nagiosplug-devel] check_disk_smb problem In-Reply-To: <1B6358FB8E7F9843AB3631A90C330B8501032D@slexchange2.fairbankscapital.com> Message-ID: Thanks for the bug report. should be fixed in cvs. Have not addressed the admin share issue as yet. -sg On Wed, 19 Jun 2002, J. Casalino wrote: > Greetings. > > I've been playing with the NetSaint 1.2.9-4 check_disk_smb plugin today. > I noticed the following errant behavior in the WARNING and CRITICAL > notifications. > > * If I specify a percentage, the plugin appears to work as designed. As > soon as I cross the warning threshold percent specified on the > commandline, I receive the warning notification, and as soon as I cross > the critical threshold percent, I receive the critical threshold > notification. > > * If I use the M(byte) or G(byte) for warning/critical thresholds, I > never receive a warning -- I go straight to critical no matter what the > warning threshold is set to. > > I made some quick modifications to the check_disk_smb plugin to verify > my suspicions, since I didn't know any other way to display whether I > was exiting the script with a warning or critical state. Watch what > happens here (username and password sanitized): > > Using the default values of warning at 85% and critical at 95% I receive > this output: > [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u > -p > Disk ok - 3.3G (29%) free on \\172.16.2.36\log > > Using the thresholds where I want them, at 70% warning and 90% critical, > I receive the following: > [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u > -p -w70 -c90 > WARNING -- Only 3.3G (29%) free on \\172.16.2.36\log > > Using a threshold for warning at 3500M and critical at 1000M, I get the > following: > [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u > -p -w3500M -c1000M > CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log > > Same result if I use 3G and 1G instead of 3500M and 1000M: > [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u > -p -w3G -c1G > CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log > > But even more interesting, even if I specify 2G and 1G for > warning/critical thresholds respectively, I receive: > [root at SLNetSaint plugins-scripts]# check_disk_smb 172.16.2.36 log -u > -p -w2G -c1G > CRITICAL -- Only 3.3G (29%) free on \\172.16.2.36\log > > I checked the Nagios v1.3 check_disk_smb plugin and it appears that some > of the perl was cleaned up, but the logic is largely the same as the > NetSaint 1.2.9-4 plugin. If I had any idea where to start with this I > would, but I'm not familiar enough with CVS or perl to feel comfortable > hacking the logic on this one. > > In addition, I'd like to suggest two items for check_disk_smb: > > 1) I think that check_disk_smb *should* also report WARNING -- or > CRITICAL -- like the modifications I made above so that it's easier to > troubleshoot warning/critical threshold problems. > > 2) check_disk_smb currently does not support checking administrative or > hidden shares on servers such as c$, d$, e$, etc... While I don't want > to create a domain admin user just to allow NetSaint/Nagios to check > drive space, it would be quite handy to be able to specify a hidden > share such as log$ in the example above so users wouldn't be able to see > shares they should not have access to. > > Thanks! > > J. Casalino > Sr. Network Administrator, Fairbanks Capital Corp. > josephc at fairbankscapital.com > -- From sghosh at sghosh.org Wed Jun 19 21:39:03 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Jun 19 21:39:03 2002 Subject: [Nagiosplug-devel] check_disk_smb problem In-Reply-To: <1B6358FB8E7F9843AB3631A90C330B8501032D@slexchange2.fairbankscapital.com> Message-ID: On Wed, 19 Jun 2002, J. Casalino wrote: > > I made some quick modifications to the check_disk_smb plugin to verify > my suspicions, since I didn't know any other way to display whether I > was exiting the script with a warning or critical state. Watch what > happens here (username and password sanitized): > fyi: echo $? will give you the return code of the last executed command. -- -sg From sghosh at sghosh.org Fri Jun 21 00:35:03 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Fri Jun 21 00:35:03 2002 Subject: [Nagiosplug-devel] Re: R: [Netsaintplug-help] Check_snmp .....modify how to.... In-Reply-To: Message-ID: If you look through the output of snmpwalk, how will note that the last "oid" when sorted in lexicographic (dictionary) order starts with "Client DNS" So a getnext with svSvcOperatingState.10 looks for the lexicographic next for the ASCII code 10 which would be "C" in this case - the exact entry being "Client DNS" This is part of the reason we had a discussion a couple of months ago about supporting getnext or "getcolumn" functionality in check_snmp on nagiosplug-* lists. Some design work has to be acomplished to support it effectively because of the existence on sparse tables in some mibs. Specially because we don't want to implement a MIB reader to figure out the column vs index oid values. As a different solution have you tried NSClient to see if a particular process is running ? -sg On Fri, 21 Jun 2002, Pietro Bandera wrote: > > Well..... > > Thanks to your tips i get this: > > snmpgetnext 192.168.0.9 public > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState.10 > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Client DNS" = active(1) > > As you can see i used the snmpgetnext command and at the end of the mib > call "a number" > > I say a number because there isn't, as i can see, a valid > "correspondece" between the number tha i wrote 10 and the list taht i > got with snmpwalk command > > (i thought the number 10 would be "FAXCOM Queue" and not "Client DNS" > that is in 3 position in the following list) > > root at LanIt25 ~# snmpwalk 192.168.0.9 public > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Server" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Messenger" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Telefonia" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Client DNS" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Server DNS" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."VNC Server" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Client DHCP" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."RPC Locator" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Workstation" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Accesso rete" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."FAXCOM Queue" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Replica file" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Plug and Play" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Servizio SNMP" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Servizio RunAs" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Registro eventi" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Microsoft Search" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Servizi terminal" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."NetSaint NT agent" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Spooler di stampa" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Servizio Trap SNMP" = active(1) > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > ingState."Browser di computer" = active(1) > > Anyway now i can get the state value of each service but without any > true correspondece!!!!!!!!!!! > > M$ i hate you! > > Because this is far away of what i would!...in fact i need to write ONLY > the name of the service as value of a snmp_check service that would > check if a NT service is running or not using SNMP instead of netsaint > agent. > > By using this solution i have to write a numbre instead of the name of > the service and also I DON'T KNOW IF THE NUMBER WOULD BE CORRECT BECAUSE > THERE ISN'T ANY CORRESPONDENCE BETWEEN NUMBERS AND SERVICE > LIST....ARRRGGGGG!! :( > > Please if any of you have an idea let me know! > > Thanks > > Pietro > > > > Message: 2 > Date: Thu, 20 Jun 2002 11:20:08 -0400 (EDT) > From: Subhendu Ghosh > To: netsaint-users at lists.sourceforge.net > Subject: [netsaint] Re: R: [Netsaintplug-help] Check_snmp .....modify > how to.... > > do an snmpwalk and see what gets returned.. > > MS snmp agent has known bugs regarding not responding to get but > returning > the value via getnext.. > > -sg > > > -- From sghosh at sghosh.org Fri Jun 21 00:43:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Fri Jun 21 00:43:02 2002 Subject: [Nagiosplug-devel] Re: R: [Netsaintplug-help] Check_snmp .....modify how to.... In-Reply-To: Message-ID: Correction (same result) snmpwalk looks for the first lexicographic entry for the column - which "Client DNS" snmgetnext svSvcOperatingState.10 does NOT return the 10th entry, but the lexicographic next which is "Client DNS" BTW: could you sen me a copy of the MIB :) -sg On Fri, 21 Jun 2002, Subhendu Ghosh wrote: > If you look through the output of snmpwalk, how will note that the last > "oid" when sorted in lexicographic (dictionary) order starts with > "Client DNS" > > So a getnext with svSvcOperatingState.10 looks for the lexicographic next > for the ASCII code 10 which would be "C" in this case - the exact entry > being "Client DNS" > > This is part of the reason we had a discussion a couple of months ago > about supporting getnext or "getcolumn" functionality in check_snmp > on nagiosplug-* lists. > > Some design work has to be acomplished to support it effectively because > of the existence on sparse tables in some mibs. Specially because we don't > want to implement a MIB reader to figure out the column vs index oid > values. > > As a different solution have you tried NSClient to see if a particular > process is running ? > > -sg > > > > On Fri, 21 Jun 2002, Pietro Bandera wrote: > > > > > Well..... > > > > Thanks to your tips i get this: > > > > snmpgetnext 192.168.0.9 public > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState.10 > > > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Client DNS" = active(1) > > > > As you can see i used the snmpgetnext command and at the end of the mib > > call "a number" > > > > I say a number because there isn't, as i can see, a valid > > "correspondece" between the number tha i wrote 10 and the list taht i > > got with snmpwalk command > > > > (i thought the number 10 would be "FAXCOM Queue" and not "Client DNS" > > that is in 3 position in the following list) > > > > root at LanIt25 ~# snmpwalk 192.168.0.9 public > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Server" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Messenger" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Telefonia" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Client DNS" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Server DNS" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."VNC Server" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Client DHCP" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."RPC Locator" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Workstation" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Accesso rete" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."FAXCOM Queue" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Replica file" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Plug and Play" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Servizio SNMP" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Servizio RunAs" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Registro eventi" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Microsoft Search" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Servizi terminal" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."NetSaint NT agent" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Spooler di stampa" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Servizio Trap SNMP" = active(1) > > enterprises.lanmanager.lanmgr-2.server.svSvcTable.svSvcEntry.svSvcOperat > > ingState."Browser di computer" = active(1) > > > > Anyway now i can get the state value of each service but without any > > true correspondece!!!!!!!!!!! > > > > M$ i hate you! > > > > Because this is far away of what i would!...in fact i need to write ONLY > > the name of the service as value of a snmp_check service that would > > check if a NT service is running or not using SNMP instead of netsaint > > agent. > > > > By using this solution i have to write a numbre instead of the name of > > the service and also I DON'T KNOW IF THE NUMBER WOULD BE CORRECT BECAUSE > > THERE ISN'T ANY CORRESPONDENCE BETWEEN NUMBERS AND SERVICE > > LIST....ARRRGGGGG!! :( > > > > Please if any of you have an idea let me know! > > > > Thanks > > > > Pietro > > > > > > > > Message: 2 > > Date: Thu, 20 Jun 2002 11:20:08 -0400 (EDT) > > From: Subhendu Ghosh > > To: netsaint-users at lists.sourceforge.net > > Subject: [netsaint] Re: R: [Netsaintplug-help] Check_snmp .....modify > > how to.... > > > > do an snmpwalk and see what gets returned.. > > > > MS snmp agent has known bugs regarding not responding to get but > > returning > > the value via getnext.. > > > > -sg > > > > > > > > -- From code at novageeks.org Wed Jun 26 11:27:02 2002 From: code at novageeks.org (local.coder) Date: Wed Jun 26 11:27:02 2002 Subject: [Nagiosplug-devel] Latest CVS Automake Message-ID: <1025116285.3d1a087ddfab3@www.novageeks.org> Hello all, Running FreeBSD 4.5 and trying to work with the latest tree. Getting this on automake automake: configure.in: `AM_INIT_AUTOMAKE' must be used /usr/local/share/automake/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL /usr/local/share/automake/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL /usr/local/share/automake/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL /usr/local/share/automake/am/lang-compile.am: AMDEP does not appear in AM_CONDITIONAL Which then leads to a whole slew of @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/check_tcp.Po at am__quote@ in the Makefile.in which then hit Makefile so nothing will compile. Any ideas on this ? Thanks ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ From sghosh at sghosh.org Wed Jun 26 11:45:04 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Jun 26 11:45:04 2002 Subject: [Nagiosplug-devel] Latest CVS Automake In-Reply-To: <1025116285.3d1a087ddfab3@www.novageeks.org> Message-ID: On Wed, 26 Jun 2002, local.coder wrote: > Hello all, > > Running FreeBSD 4.5 and trying to work with the latest tree. > > Getting this on automake > > automake: configure.in: `AM_INIT_AUTOMAKE' must be used > /usr/local/share/automake/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL > /usr/local/share/automake/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL > /usr/local/share/automake/am/depend2.am: AMDEP does not appear in AM_CONDITIONAL > /usr/local/share/automake/am/lang-compile.am: AMDEP does not appear in > AM_CONDITIONAL > > Which then leads to a whole slew of > @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/check_tcp.Po at am__quote@ > > in the Makefile.in which then hit Makefile so nothing will compile. > > Any ideas on this ? > Thanks > Pls use autoconf 2.13 and automake 1.4/1.5 Need to update files to supports lates autoconf/automake -sg -- From nagios at nagios.org Thu Jun 27 22:05:02 2002 From: nagios at nagios.org (Ethan Galstad) Date: Thu Jun 27 22:05:02 2002 Subject: [Nagiosplug-devel] Re: Major Secuirty Hole in Netsaint/Nagios. In-Reply-To: <20020627213146.GE30691@fleen.ilan.net> Message-ID: <3D1BA854.5586.8150CD@localhost> Tyler - Thanks for the note. I'm forwarding this to the nagios-devel and nagiosplug-devel lists, as I think this should be discussed there with others before making changes. As far as patches are concerned, I won't be able to make any until at least next week. My cable provider just did an "upgrade" which now puts me 18 hops away from the DHCP server - this caused the ISC DHCP client on my LRP box to croak (TTL is hardcoded to16 in the DHCPDISCOVER packet), so I've been fighting with trying to recompile a hacked version of the client that will actually run properly on my firewall. To top that off, I just discovered that the power supply in my development box died sometime in the past few days and my case is a nice toasty 110 degrees.... So I have to wait until it cools down before trying to build a new box tomorrow or this weekend. I love the timing of problems... :-) -- Anyway, on to the issue at hand. I had been thinking about stripping all single and double quotes out of the plugin output, so this might was well be the time to do it all. This of course will break any plugin that returns a hyperlink in the output. I would like to keep the following characters, available for output, as they are more benign without the help of others, especially is quoted properly in notification commands, etc: (,),!,? It was not mentioned, but % is also a potentially nasty character, but I still think it should stay (e.g. for packet loss percentages in check_ping, check_disk, etc). It all comes down to a tradeoff between security and flexibility. I believe that the five characters I mention should be okay, as long as notification commands, etc. contain quotes to prevent the shell from interpreting them. That's more of a user education issue than anything else. BTW, although the message only mentioned stripping these chars from plugin output (and acknowledgements), I should probably also strip these from names of hosts, services, etc. Anyone see a good reason not to strip these characters? On 27 Jun 2002 at 17:31, Tyler Lund wrote: > Hello, > > I have found what I think to be a major security flaw in the current > stable 0.0.7 release of Netsaint. From what I can tell, this flaw > also exists in the current 1.0 beta 3 release of Nagios. > > Basically the macro_output string does not get checked for shell > interpreted characters prior to being executed by popen() in my_sysem(). > > This was discovered when attempting to insert an apostrophie character > into an ack command and noting that the character was interpreted by > the shell. Further investigation revealed that ANY special shell > character will be interpreted, including a backtick ` character. This > will allow anyone acking an alarm to execute arbitrary commands on the > server as the netsaint user. > > Extapolating, this macro is also used to store output from service > checks, including strings passed to it from NRPE and other agents. > Using this method, an attacker would be able to execute commands on the > central netsaint server by modifying output from a monitored host. It > would be pretty trivial to gain access to the central server depending > on the permissions of the user under which netsaint is running. > > Has this issue been addressd before? I've searched mailing lists and > Changelogs to no avail. I'm sure this can be implimented > in a cleaner fashion, but I've patched my 0.0.7 source files > to sterilize macros for shell execution: > > char *sanitize_shell_string(char *str) > /* takes string and escapes all metacharacters. should be used before > including string in system() or similar call. */ > { > int i,j = 0; > char *new = malloc(sizeof(char) * (strlen(str) * 2 + 1)); > for (i = 0; i < strlen(str); i++) { > switch (str[i]) { > case '|': case '&': case ';': case '(': case ')': case '<': > case '>': case '\'': case '"': case '*': case '?': case '\\': > case '[': case ']': case '$': case '!': case '#': case '`': > case '{': case '}': > new[j] = '\\'; > j++; > break; > default: > break; > } > new[j] = str[i]; > j++; > } > new[j] = '\0'; > return new; > } > > and in process_macros(): > > else if(!strcmp(temp_buffer,"OUTPUT")) { > char *clean = sanitize_shell_string(macro_output); > strncat(output_buffer,(macro_output==NULL)?"":clean,buffer_length-strlen(clean)-1); > } > > ...repeat for other macros, etc. > > If I'm way off on this for Nagios please let me know, but I would suggest > that for at least Netsaint that a patch release be made for this > extremely dangerous flaw. > > Thanks! > > -- > Tyler Lund - Sr. Network Engineer, Springboard Hosting > tlund at springboardhosting.com - www.springboardhosting.com > *** Thank you for contacting Springboard Support *** > *** support at springboardhosting.com 919-852-0690 *** > Ethan Galstad, Nagios Developer --- Email: nagios at nagios.org Website: http://www.nagios.org From sghosh at sghosh.org Fri Jun 28 08:00:11 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Fri Jun 28 08:00:11 2002 Subject: [Nagiosplug-devel] Re: Major Secuirty Hole in Netsaint/Nagios. In-Reply-To: <3D1BA854.5586.8150CD@localhost> Message-ID: I understand the issue but would like to see if it is possible to return a hyperlink in the output, at least in the case that the plugins are executed locally. Since there is no differentiation between local and remote that would be hard to currently. The other way would be to allow only the urlize plugin to pass a hyperlink. The third option would be to add a field to the config that creates the hyperlink - i.e internalize the urlize plugin into nagios. I have found it very useful for links to traceroute and other tools. Other than the above comments, I think the five characters below should suffice. About host names and service names - my preference has been to write them in following case sensitive DNS naming rules. So removing the characters from the names would not be a bad thing. Question - should the plugins be forced to check / sanitize their output to limit themsleves to alphanumeric+5? I would think - yes, but not to escape anything. The escape should be done on the receiving end. A couple of other things - I am not sure about as yet... 1. Does this have any impact on the check_command 2. Does this have an impact on the maxsize of the input and output buffers On Fri, 28 Jun 2002, Ethan Galstad wrote: > > Anyway, on to the issue at hand. I had been thinking about stripping > all single and double quotes out of the plugin output, so this might > was well be the time to do it all. This of course will break any > plugin that returns a hyperlink in the output. > > I would like to keep the following characters, available for output, > as they are more benign without the help of others, especially is > quoted properly in notification commands, etc: > > (,),!,? > > It was not mentioned, but % is also a potentially nasty character, > but I still think it should stay (e.g. for packet loss percentages in > check_ping, check_disk, etc). It all comes down to a tradeoff > between security and flexibility. I believe that the five characters > I mention should be okay, as long as notification commands, etc. > contain quotes to prevent the shell from interpreting them. That's > more of a user education issue than anything else. > > BTW, although the message only mentioned stripping these chars from > plugin output (and acknowledgements), I should probably also strip > these from names of hosts, services, etc. Anyone see a good reason > not to strip these characters? > > > > On 27 Jun 2002 at 17:31, Tyler Lund wrote: > > > Hello, > > > > I have found what I think to be a major security flaw in the current > > stable 0.0.7 release of Netsaint. From what I can tell, this flaw > > also exists in the current 1.0 beta 3 release of Nagios. > > > > Basically the macro_output string does not get checked for shell > > interpreted characters prior to being executed by popen() in my_sysem(). > > > > This was discovered when attempting to insert an apostrophie character > > into an ack command and noting that the character was interpreted by > > the shell. Further investigation revealed that ANY special shell > > character will be interpreted, including a backtick ` character. This > > will allow anyone acking an alarm to execute arbitrary commands on the > > server as the netsaint user. > > > > Extapolating, this macro is also used to store output from service > > checks, including strings passed to it from NRPE and other agents. > > Using this method, an attacker would be able to execute commands on the > > central netsaint server by modifying output from a monitored host. It > > would be pretty trivial to gain access to the central server depending > > on the permissions of the user under which netsaint is running. > > > > Has this issue been addressd before? I've searched mailing lists and > > Changelogs to no avail. I'm sure this can be implimented > > in a cleaner fashion, but I've patched my 0.0.7 source files > > to sterilize macros for shell execution: > > > > char *sanitize_shell_string(char *str) > > /* takes string and escapes all metacharacters. should be used before > > including string in system() or similar call. */ > > { > > int i,j = 0; > > char *new = malloc(sizeof(char) * (strlen(str) * 2 + 1)); > > for (i = 0; i < strlen(str); i++) { > > switch (str[i]) { > > case '|': case '&': case ';': case '(': case ')': case '<': > > case '>': case '\'': case '"': case '*': case '?': case '\\': > > case '[': case ']': case '$': case '!': case '#': case '`': > > case '{': case '}': > > new[j] = '\\'; > > j++; > > break; > > default: > > break; > > } > > new[j] = str[i]; > > j++; > > } > > new[j] = '\0'; > > return new; > > } > > > > and in process_macros(): > > > > else if(!strcmp(temp_buffer,"OUTPUT")) { > > char *clean = sanitize_shell_string(macro_output); > > strncat(output_buffer,(macro_output==NULL)?"":clean,buffer_length-strlen(clean)-1); > > } > > > > ...repeat for other macros, etc. > > > > If I'm way off on this for Nagios please let me know, but I would suggest > > that for at least Netsaint that a patch release be made for this > > extremely dangerous flaw. > > > > Thanks! > > > > -- > > Tyler Lund - Sr. Network Engineer, Springboard Hosting > > tlund at springboardhosting.com - www.springboardhosting.com > > *** Thank you for contacting Springboard Support *** > > *** support at springboardhosting.com 919-852-0690 *** > > > > Ethan Galstad, > Nagios Developer > --- -sg -- From code at novageeks.org Fri Jun 28 12:01:49 2002 From: code at novageeks.org (local.coder) Date: Fri Jun 28 12:01:49 2002 Subject: [Nagiosplug-devel] CVS Issues Message-ID: <1025291124.3d1cb3748e7fa@www.novageeks.org> Here is what I have found and hopefully someone who understands autoconf and automake better than me can look at these two items. First thanks to Subhendu who helped me to find out that I had too new an automake and autoconf. So somewhere in the readme can it be added that you must use autoconf 2.13 and automake 1.4. Anything newer has problems when you get to automake. So with those installed I know had makefiles. I ran configure and the only issue I got was with plugins/Makefile line 752 which had just this -include $(DEP_FILES) My best guess would be that there is something missing before the - but I didn't see this line anywhere in the old netsaint-plugins cvs makefiles. Last and most perplexing was the make itself. make all was working except none of the includes options were there so I got getopt.h missing errors. I tried several things but what finally fixed it was to add -I. onto my CC= gcc definition. The gcc ended up looking like this when make was run. gcc -g -O2 -c check_disk.c After all this I now have compiled CVS plugins. Hope this info helps those working on autoconfs. My config is FreeBSD 4.5 Current. Thanks. M~ ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ From code at novageeks.org Fri Jun 28 12:18:15 2002 From: code at novageeks.org (local.coder) Date: Fri Jun 28 12:18:15 2002 Subject: [Nagiosplug-devel] More on CVS Message-ID: <1025292129.3d1cb76110cdb@www.novageeks.org> After I had all the basics from the previous email done I then moved the whole tarball to a Solaris 8 server. Reran configure and did a make. It worked better and my make now looked like this. gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -I. -I. -I. -I. -g -O2 -c check_disk.c So the other problem I was seeing seems to be a FreeBSD thing. Thanks. M~ ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ From sghosh at sghosh.org Fri Jun 28 13:53:02 2002 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Fri Jun 28 13:53:02 2002 Subject: [Nagiosplug-devel] CVS Issues In-Reply-To: <1025291124.3d1cb3748e7fa@www.novageeks.org> Message-ID: Thanks for the update. I'll put a note in the INSTALL doc assuggested... BTW: did you try the tarball on FreeBSD - be interested to know if that has any issues... -sg On Fri, 28 Jun 2002, local.coder wrote: > > Here is what I have found and hopefully someone who understands autoconf and > automake better than me can look at these two items. > > First thanks to Subhendu who helped me to find out that I had too new an > automake and autoconf. So somewhere in the readme can it be added that you must > use autoconf 2.13 and automake 1.4. Anything newer has problems when you get to > automake. So with those installed I know had makefiles. I ran configure and the > only issue I got was with plugins/Makefile line 752 which had just this > -include $(DEP_FILES) > > My best guess would be that there is something missing before the - but I > didn't see this line anywhere in the old netsaint-plugins cvs makefiles. > > Last and most perplexing was the make itself. make all was working except none > of the includes options were there so I got getopt.h missing errors. > > I tried several things but what finally fixed it was to add -I. onto my CC= gcc > definition. The gcc ended up looking like this when make was run. > gcc -g -O2 -c check_disk.c > > After all this I now have compiled CVS plugins. Hope this info helps those > working on autoconfs. > > My config is FreeBSD 4.5 Current. > > Thanks. > M~ > > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/ > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Caffeinated soap. No kidding. > http://thinkgeek.com/sf > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > -- From nagios at nagios.org Sun Jun 30 22:48:02 2002 From: nagios at nagios.org (Ethan Galstad) Date: Sun Jun 30 22:48:02 2002 Subject: [Nagiosplug-devel] Re: Major Secuirty Hole in Netsaint/Nagios. In-Reply-To: References: <3D1BA854.5586.8150CD@localhost> Message-ID: <3D1FA71E.1284.2D446A3@localhost> I just posted updated code to CVS today to take a stab at fixing this. I added an "illegal_macro_output_chars" variable to the main config file that allow the user what characters should be stripped from the $OUTPUT and $PERFDATA macros before they are substituted. Currently the nasty chars (that the user can specify) are stripped out completely - no escaping is done of anything that remains int he macros, although we could think about doing this as well. I decided to only strip the macros before they're substituted into notification commands, performance data commands, event handlers, etc. No characters are stripped from the internal buffers that actually hold the plugin output, as I want to retain this. I don't see a problem with keeping these characters internally or writing them out to the status log (as they are never used in a command). On 28 Jun 2002 at 10:59, Subhendu Ghosh wrote: > I understand the issue but would like to see if it is possible to return a > hyperlink in the output, at least in the case that the plugins are > executed locally. Since there is no differentiation between local and > remote that would be hard to currently. > > The other way would be to allow only the urlize plugin to pass a > hyperlink. > > The third option would be to add a field to the config that creates the > hyperlink - i.e internalize the urlize plugin into nagios. > > I have found it very useful for links to traceroute and other tools. Do you use the links from the web or wap interface? Or from the notification messages you receive. The way I wrote things, quotes would be stripped from the output macro for notifications, but would remain in the status data for viewing via the web interface. So that won't break hyperlinks for most users. > > Other than the above comments, I think the five characters below should > suffice. > > About host names and service names - my preference has been to write them > in following case sensitive DNS naming rules. So removing the characters > from the names would not be a bad thing. I added an "illegal_object_name_chars" variable to the main config file. Instead of enforcing what is and isn't legal, I decided to let the user decide. Single and double quotes in object names can cause web interface issues though, so its best to not allow them in object names. > > Question - should the plugins be forced to check / sanitize their output > to limit themsleves to alphanumeric+5? > I would think - yes, but not to escape anything. Well, we could... but in the end its not very effective, since its easy to write custom plugins that break the rules. The sanitization should happen within Nagios. > > The escape should be done on the receiving end. I was thinking about this and I don't know if we actually need to try and escape anything. One problem is that I don't know how the user's commands are defined and how they'll handle escaped characters. The other thing is that if you strip out most nasty characters (backtick, etc.), you should be okay with leaving more benign characters like ()?! unescaped. This assumes that the user is enclosing the macros in quotes in their command definitions. > > > A couple of other things - I am not sure about as yet... > > 1. Does this have any impact on the check_command Nope - only the $OUTPUT and $PERFDATA macros are sanitizes before the are sent to notification commands, performance data, event handlers, etc. > > 2. Does this have an impact on the maxsize of the input and output > buffers No again - the way I did things, nothing gets done until the macros are just about to be substituted into command lines that are going to be executed. > > > > On Fri, 28 Jun 2002, Ethan Galstad wrote: > > > > > > Anyway, on to the issue at hand. I had been thinking about stripping > > all single and double quotes out of the plugin output, so this might > > was well be the time to do it all. This of course will break any > > plugin that returns a hyperlink in the output. > > > > I would like to keep the following characters, available for output, > > as they are more benign without the help of others, especially is > > quoted properly in notification commands, etc: > > > > (,),!,? > > > > It was not mentioned, but % is also a potentially nasty character, > > but I still think it should stay (e.g. for packet loss percentages in > > check_ping, check_disk, etc). It all comes down to a tradeoff > > between security and flexibility. I believe that the five characters > > I mention should be okay, as long as notification commands, etc. > > contain quotes to prevent the shell from interpreting them. That's > > more of a user education issue than anything else. > > > > BTW, although the message only mentioned stripping these chars from > > plugin output (and acknowledgements), I should probably also strip > > these from names of hosts, services, etc. Anyone see a good reason > > not to strip these characters? > > > > > > > > On 27 Jun 2002 at 17:31, Tyler Lund wrote: > > > > > Hello, > > > > > > I have found what I think to be a major security flaw in the current > > > stable 0.0.7 release of Netsaint. From what I can tell, this flaw > > > also exists in the current 1.0 beta 3 release of Nagios. > > > > > > Basically the macro_output string does not get checked for shell > > > interpreted characters prior to being executed by popen() in my_sysem(). > > > > > > This was discovered when attempting to insert an apostrophie character > > > into an ack command and noting that the character was interpreted by > > > the shell. Further investigation revealed that ANY special shell > > > character will be interpreted, including a backtick ` character. This > > > will allow anyone acking an alarm to execute arbitrary commands on the > > > server as the netsaint user. > > > > > > Extapolating, this macro is also used to store output from service > > > checks, including strings passed to it from NRPE and other agents. > > > Using this method, an attacker would be able to execute commands on the > > > central netsaint server by modifying output from a monitored host. It > > > would be pretty trivial to gain access to the central server depending > > > on the permissions of the user under which netsaint is running. > > > > > > Has this issue been addressd before? I've searched mailing lists and > > > Changelogs to no avail. I'm sure this can be implimented > > > in a cleaner fashion, but I've patched my 0.0.7 source files > > > to sterilize macros for shell execution: > > > > > > char *sanitize_shell_string(char *str) > > > /* takes string and escapes all metacharacters. should be used before > > > including string in system() or similar call. */ > > > { > > > int i,j = 0; > > > char *new = malloc(sizeof(char) * (strlen(str) * 2 + 1)); > > > for (i = 0; i < strlen(str); i++) { > > > switch (str[i]) { > > > case '|': case '&': case ';': case '(': case ')': case '<': > > > case '>': case '\'': case '"': case '*': case '?': case '\\': > > > case '[': case ']': case '$': case '!': case '#': case '`': > > > case '{': case '}': > > > new[j] = '\\'; > > > j++; > > > break; > > > default: > > > break; > > > } > > > new[j] = str[i]; > > > j++; > > > } > > > new[j] = '\0'; > > > return new; > > > } > > > > > > and in process_macros(): > > > > > > else if(!strcmp(temp_buffer,"OUTPUT")) { > > > char *clean = sanitize_shell_string(macro_output); > > > strncat(output_buffer,(macro_output==NULL)?"":clean,buffer_length-strlen(clean)-1); > > > } > > > > > > ...repeat for other macros, etc. > > > > > > If I'm way off on this for Nagios please let me know, but I would suggest > > > that for at least Netsaint that a patch release be made for this > > > extremely dangerous flaw. > > > > > > Thanks! > > > > > > -- > > > Tyler Lund - Sr. Network Engineer, Springboard Hosting > > > tlund at springboardhosting.com - www.springboardhosting.com > > > *** Thank you for contacting Springboard Support *** > > > *** support at springboardhosting.com 919-852-0690 *** > > > > > > > Ethan Galstad, > > Nagios Developer > > --- > > -sg > -- > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Caffeinated soap. No kidding. > http://thinkgeek.com/sf > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > Ethan Galstad, Nagios Developer --- Email: nagios at nagios.org Website: http://www.nagios.org