From noreply at sourceforge.net Thu Jan 1 11:41:27 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Jan 1 11:41:27 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-866485 ] Overflow in check_swap Message-ID: Bugs item #866485, was opened at 2003-12-28 00:56 Message generated for change (Comment added) made by jformann You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=866485&group_id=29880 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Johannes Formann (jformann) Assigned to: Nobody/Anonymous (nobody) Summary: Overflow in check_swap Initial Comment: When running check_swap on server with more than 4 GB swap (in this case with about 16 GB) it will report a false percentage as beeing used: /opt/master/nagios/libexec/check_swap -w 30% -c 70% WARNING - Swap used: 32% (1412804608 out of 4294967295) # free total used free shared buffers cached Mem: 4011044 4001688 9356 0 23168 3668088 -/+ buffers/cache: 310432 3700612 Swap: 16097500 1379860 14717640 I've checked this from 1.3 over 1.3.1 up to 1.4a1 I think the vars must be changed from long to long long. ---------------------------------------------------------------------- >Comment By: Johannes Formann (jformann) Date: 2004-01-01 20:40 Message: Logged In: YES user_id=938859 Someone was so nice, to take a look (thanks Hunz) and made me a smal patch I'd like to share *** ../nagios-plugins-1.4.0alpha1/plugins/check_swap.c Wed Nov 12 05:37:19 2003 --- plugins/check_swap.c Thu Jan 1 19:28:34 2004 *************** *** 82,87 **** --- 82,95 ---- #ifdef HAVE_PROC_MEMINFO fp = fopen (PROC_MEMINFO, "r"); while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) { + unsigned long tmp; + if(sscanf(input_buffer, "%s %lu", str, &tmp)==2) { + if(! strncmp(str,"SwapTotal",strlen("SwapTotal"))) + total_swap+=(tmp>>10); + else if(! strncmp(str,"SwapFree",strlen("SwapFree"))) + free_swap+=(tmp>>10); + } + /* if (sscanf (input_buffer, " %s %lu %lu %lu", str, &dsktotal, &dskused, &dskfree) == 4 && strstr (str, "Swap")) { dsktotal = dsktotal / 1048576; *************** *** 97,104 **** --- 105,114 ---- asprintf (&status, "%s [%lu (%d%%)]", status, dskfree, 100 - percent); } } + */ } fclose(fp); + used_swap=total_swap-free_swap; #else # ifdef HAVE_SWAP asprintf(&swap_command, "%s", SWAP_COMMAND); *************** *** 240,246 **** check_swap (int usp, long unsigned int free_swap) { int result = STATE_UNKNOWN; - free_swap = free_swap * 1024; /* Convert back to bytes as warn and crit specified in bytes */ if (usp >= 0 && crit_percent != 0 && usp >= (100.0 - crit_percent)) result = STATE_CRITICAL; else if (crit_size > 0 && free_swap <= crit_size) --- 251,256 ---- *************** *** 399,411 **** printf (_("\n -w, --warning=INTEGER\n! Exit with WARNING status if less than INTEGER bytes of swap space are free\n -w, --warning=PERCENT%%\n! Exit with WARNING status if less than PERCENT of swap space has been used\n -c, --critical=INTEGER\n! Exit with CRITICAL status if less than INTEGER bytes of swap space are free\n -c, --critical=PERCENT%%\n! Exit with CRITCAL status if less than PERCENT of swap space has been used\n -a, --allswaps\n Conduct comparisons for all swap partitions, one by one\n")); --- 410,422 ---- printf (_("\n -w, --warning=INTEGER\n! Exit with WARNING status if less than INTEGER mega bytes of swap space are free\n -w, --warning=PERCENT%%\n! Exit with WARNING status if less than PERCENT of swap space are free\n -c, --critical=INTEGER\n! Exit with CRITICAL status if less than INTEGER mega bytes of swap space are free\n -c, --critical=PERCENT%%\n! Exit with CRITCAL status if less than PERCENT of swap space are free\n -a, --allswaps\n Conduct comparisons for all swap partitions, one by one\n")); *************** *** 426,433 **** print_usage (void) { printf (_("Usage:\n! %s [-a] -w %% -c %%\n! %s [-a] -w -c \n %s (-h | --help) for detailed help\n %s (-V | --version) for version information\n"), progname, progname, progname, progname); --- 437,444 ---- print_usage (void) { printf (_("Usage:\n! %s [-a] -w %% -c %%\n! %s [-a] -w -c \n %s (-h | --help) for detailed help\n %s (-V | --version) for version information\n"), progname, progname, progname, progname); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=866485&group_id=29880 From noreply at sourceforge.net Thu Jan 1 11:44:08 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Jan 1 11:44:08 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-868900 ] check_swap fix for more than 4GB of swap Message-ID: Patches item #868900, was opened at 2004-01-01 20:43 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=868900&group_id=29880 Category: Bugfix Group: None Status: Open Resolution: None Priority: 5 Submitted By: Johannes Formann (jformann) Assigned to: Nobody/Anonymous (nobody) Summary: check_swap fix for more than 4GB of swap Initial Comment: This patch fixes the problem with wron warning when using more than 4GB of swap. *** ../nagios-plugins-1.4.0alpha1/plugins/check_swap.c Wed Nov 12 05:37:19 2003 --- plugins/check_swap.c Thu Jan 1 19:28:34 2004 *************** *** 82,87 **** --- 82,95 ---- #ifdef HAVE_PROC_MEMINFO fp = fopen (PROC_MEMINFO, "r"); while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, fp)) { + unsigned long tmp; + if(sscanf(input_buffer, "%s %lu", str, &tmp)==2) { + if(! strncmp(str,"SwapTotal",strlen("SwapTotal"))) + total_swap+=(tmp>>10); + else if(! strncmp(str,"SwapFree",strlen("SwapFree"))) + free_swap+=(tmp>>10); + } + /* if (sscanf (input_buffer, " %s %lu %lu %lu", str, &dsktotal, &dskused, &dskfree) == 4 && strstr (str, "Swap")) { dsktotal = dsktotal / 1048576; *************** *** 97,104 **** --- 105,114 ---- asprintf (&status, "%s [%lu (%d%%)]", status, dskfree, 100 - percent); } } + */ } fclose(fp); + used_swap=total_swap-free_swap; #else # ifdef HAVE_SWAP asprintf(&swap_command, "%s", SWAP_COMMAND); *************** *** 240,246 **** check_swap (int usp, long unsigned int free_swap) { int result = STATE_UNKNOWN; - free_swap = free_swap * 1024; /* Convert back to bytes as warn and crit specified in bytes */ if (usp >= 0 && crit_percent != 0 && usp >= (100.0 - crit_percent)) result = STATE_CRITICAL; else if (crit_size > 0 && free_swap <= crit_size) --- 251,256 ---- *************** *** 399,411 **** printf (_("\n -w, --warning=INTEGER\n! Exit with WARNING status if less than INTEGER bytes of swap space are free\n -w, --warning=PERCENT%%\n! Exit with WARNING status if less than PERCENT of swap space has been used\n -c, --critical=INTEGER\n! Exit with CRITICAL status if less than INTEGER bytes of swap space are free\n -c, --critical=PERCENT%%\n! Exit with CRITCAL status if less than PERCENT of swap space has been used\n -a, --allswaps\n Conduct comparisons for all swap partitions, one by one\n")); --- 410,422 ---- printf (_("\n -w, --warning=INTEGER\n! Exit with WARNING status if less than INTEGER mega bytes of swap space are free\n -w, --warning=PERCENT%%\n! Exit with WARNING status if less than PERCENT of swap space are free\n -c, --critical=INTEGER\n! Exit with CRITICAL status if less than INTEGER mega bytes of swap space are free\n -c, --critical=PERCENT%%\n! Exit with CRITCAL status if less than PERCENT of swap space are free\n -a, --allswaps\n Conduct comparisons for all swap partitions, one by one\n")); *************** *** 426,433 **** print_usage (void) { printf (_("Usage:\n! %s [-a] -w %% -c %%\n! %s [-a] -w -c \n %s (-h | --help) for detailed help\n %s (-V | --version) for version information\n"), progname, progname, progname, progname); --- 437,444 ---- print_usage (void) { printf (_("Usage:\n! %s [-a] -w %% -c %%\n! %s [-a] -w -c \n %s (-h | --help) for detailed help\n %s (-V | --version) for version information\n"), progname, progname, progname, progname); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=868900&group_id=29880 From noreply at sourceforge.net Sat Jan 3 02:20:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Jan 3 02:20:01 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-619255 ] New plugin: check_mysqlslave.pl Message-ID: New Plugins item #619255, was opened at 2002-10-06 14:23 Message generated for change (Comment added) made by chengfu You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=619255&group_id=29880 Category: Application monitor Group: None Status: Open Resolution: None Priority: 3 Submitted By: Mario Witte (chengfu) Assigned to: Nobody/Anonymous (nobody) Summary: New plugin: check_mysqlslave.pl Initial Comment: I'd like to contribute the attaches service check plugin. check_mysqlslave.pl checks if a MySQL-Replication is still running. The attached archive contains the skript itself, a patch to configure.in and a patch to plugin-scripts/Makefile.am. I tried to create the script as outlined in the developer guidelines, but if there are flaws or errors or whatever please contact me. ---------------------------------------------------------------------- >Comment By: Mario Witte (chengfu) Date: 2004-01-03 10:19 Message: Logged In: YES user_id=63997 According to http://www.mysql.com/doc/en/GRANT.html only "PROCESS"-rights should be needed to execute SHOW PROCESSLIST. ---------------------------------------------------------------------- Comment By: Ton Voon (tonvoon) Date: 2003-01-30 17:05 Message: Logged In: YES user_id=664364 Thanks for the patch. New plugins are not a priority for 1.3, but will be considered for 1.4. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2003-01-02 15:59 Message: Logged In: NO I am just wandering what privileges must have the user to execute "show slave status" ( in order for plugin to work )? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=619255&group_id=29880 From noreply at sourceforge.net Sun Jan 4 13:56:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Jan 4 13:56:01 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-870548 ] Plugin 1.4.0a1 -> /bin/ping does not terminate Message-ID: Bugs item #870548, was opened at 2004-01-04 21:55 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=870548&group_id=29880 Category: Argument proccessing Group: None Status: Open Resolution: None Priority: 5 Submitted By: Christian Exner (banane2000) Assigned to: Nobody/Anonymous (nobody) Summary: Plugin 1.4.0a1 -> /bin/ping does not terminate Initial Comment: On our system (Suse 8.1, Nagios 2.0a1, Plugins 1.4.0a1) i've detected about 400+ /bin/ping processes going all to only 2 IP-addresses (yes... only if the failure takes a long time but our failures often takes the whole weekend if the german Telekom cuts the DSL-Line of one of our external offices...). It seems that check_ping calls "/bin/ping -n -U -c 5 x.x.x.x" for checking. If pinged host is not reacheable /bin/ping does not terminate for a very long time (maybe until the failed host answers again). check_ping terminates after 10 secs. This is also documented in nagios web interface. But corresponding /bin/ping process stays active. Maybe it would help to pass "-w" (deadline) parameter to /bin/ping to force a termination after some time in such a case. Chris ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=870548&group_id=29880 From pla at softflare.com Thu Jan 8 04:57:05 2004 From: pla at softflare.com (Paul L. Allen) Date: Thu Jan 8 04:57:05 2004 Subject: [Nagiosplug-devel] check_qmailq Message-ID: <20040108125558.13159.qmail@minnow.softflare.net> I tried the check_qmailq plugin from the contrib directory and found it somewhat lacking because the critical and warning limits are hard-wired. So I ended up rewriting it. In the course of writing it I found it useful to make some changes to utils.pm to avoid the necessity to duplicate code. For example, the current usage routine exits with an unknown status, meaning that if you want to print the usage in the help text you essentially have to do the same thing a different way. With the following change, calling usage in void context results in the current behavior but calling it in scalar or array context (such as print usage("Whatever\n");) results in it printing the usage without exiting. It could be more efficient, but not without breaking the existing usage. sub usage { return(sprintf(shift(@_), @_)) if (defined(wantarray)); printf(@_); exit $ERRORS{UNKNOWN}; } Another thing I found useful in avoiding inconsistencies between exit status and textual response was: %ERROR_FLAGS = reverse(%ERRORS); Most perl plugins seem to determine the status code then use if statements to work out what to print at the start of the textual response. With %ERROR_FLAGS this can be simplified to: print "$ERROR_FLAGS{$status} - $queue messages in queue...\n" I also wrote a check_range routine that (I hope) accepts a metric and a numeric or percentage range in all possible forms and returns true if the metric is OK. It takes an optional parameter for use in constructing error messages about malformed ranges. It's a bit long to paste here, but I'm happy to mail it if you want. So the question is, do you want my check_qmailq? If so, will you incorporate the changes in utils.pm or should I pull them out of my local utils.pm and stick them directly into my check_qmailq where they benefit me but not others? -- Paul Allen Softflare Support From Ton.Voon at egg.com Thu Jan 8 05:55:01 2004 From: Ton.Voon at egg.com (Voon, Ton) Date: Thu Jan 8 05:55:01 2004 Subject: [Nagiosplug-devel] check_qmailq Message-ID: Paul, Any contributions are most welcome. If that means a change to utils.pm, then if one of the project team thinks it makes sense, it will be incorporated. So feel free to send in your patches. I've just had a quick look at check_qmailq.pl and it looks like the functionality has been rolled into check_mailq.pl (CVS HEAD). As I don't know anything about qmail, could you look over check_mailq and see if your patches still apply to this? Ton > -----Original Message----- > From: Paul L. Allen [mailto:pla at softflare.com] > Sent: Thursday, January 08, 2004 12:56 PM > To: nagiosplug-devel at lists.sourceforge.net > Subject: [Nagiosplug-devel] check_qmailq > > > I tried the check_qmailq plugin from the contrib directory > and found it > somewhat lacking because the critical and warning limits are > hard-wired. > So I ended up rewriting it. > > In the course of writing it I found it useful to make some changes to > utils.pm to avoid the necessity to duplicate code. For example, the > current usage routine exits with an unknown status, meaning > that if you > want to print the usage in the help text you essentially have > to do the > same thing a different way. With the following change, calling > usage in void context results in the current behavior but calling it > in scalar or array context (such as print > usage("Whatever\n");) results > in it printing the usage without exiting. It could be more efficient, > but not without breaking the existing usage. > > sub usage { > return(sprintf(shift(@_), @_)) if (defined(wantarray)); > printf(@_); > exit $ERRORS{UNKNOWN}; > } > > Another thing I found useful in avoiding inconsistencies between exit > status and textual response was: > > %ERROR_FLAGS = reverse(%ERRORS); > > Most perl plugins seem to determine the status code then use > if statements > to work out what to print at the start of the textual response. With > %ERROR_FLAGS this can be simplified to: > > print "$ERROR_FLAGS{$status} - $queue messages in queue...\n" > > I also wrote a check_range routine that (I hope) accepts a metric and > a numeric or percentage range in all possible forms and returns true > if the metric is OK. It takes an optional parameter for use in > constructing error messages about malformed ranges. It's a bit long > to paste here, but I'm happy to mail it if you want. > > So the question is, do you want my check_qmailq? If so, will you > incorporate the changes in utils.pm or should I pull them out of my > local utils.pm and stick them directly into my check_qmailq where they > benefit me but not others? > > -- > Paul Allen > Softflare Support > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Perforce Software. > Perforce is the Fast Software Configuration Management System offering > advanced branching capabilities and atomic changes on 50+ platforms. > Free Eval! http://www.perforce.com/perforce/loadprog.html > _______________________________________________ > Nagiosplug-devel mailing list > Nagiosplug-devel at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel > ::: Please include plugins version (-v) and OS when reporting > any issue. > ::: Messages without supporting info will risk being sent to /dev/null > This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. From pla at softflare.com Thu Jan 8 08:13:00 2004 From: pla at softflare.com (Paul L. Allen) Date: Thu Jan 8 08:13:00 2004 Subject: [Nagiosplug-devel] Re: check_qmailq In-Reply-To: References: Message-ID: <20040108161101.3104.qmail@minnow.softflare.net> Voon, Ton writes: > I've just had a quick look at check_qmailq.pl and it looks like the > functionality has been rolled into check_mailq.pl (CVS HEAD). I just grabbed 1.4.0alpha and yes, it LOOKS that way. Three problems. 1) Starts with #!/usr/local/bin/perl 2) Whatever I do, I get spurious error messages Duplicate specification "Warning=i" for option "warning" Duplicate specification "Critical=i" for option "critical" 3) qmail-qstat is a shell script which makes use of wc, find, and expr. So unless $ENV{PATH} is set to /usr/bin all you get is a stream of complaints about no such file or directory. > As I don't know anything about qmail, could you look over check_mailq and > see if your patches still apply to this? The two patches were just things that reduced the amount of duplicated logic because I dislike code where I write the same thing more than once - it means I have to remember to change it in several places if a change is needed. And since check_mailq is doing its own limit checking, it doesn't need my range-checking routine either. However, there has been mention of standard libraries to do range-checking for a while, and nothing has appeared. What I have is at least a start (you still have to split lists of ranges yourself and convert things like 10M to purely numeric (percentages are OK because perl ignores the % sign and treats them as numbers anyway). -- Paul Allen Softflare Support From dmozingo at topechelon.com Thu Jan 8 11:46:02 2004 From: dmozingo at topechelon.com (Darrell Mozingo) Date: Thu Jan 8 11:46:02 2004 Subject: [Nagiosplug-devel] check_mrtgtraf bug Message-ID: <1073591035.2026.14.camel@localhost> I was changing the output of check_mrtgtraf to work better with our setup when I noticed a minor bug. On line 186 of check_mrtgtraf.c (Revision 1.11), change: perfdata("in", (long) adjusted_outgoing_rate, outgoing_speed_rating, to perfdata("out", (long) adjusted_outgoing_rate, outgoing_speed_rating, changing just the output from "in" to "out". This is in the latest 1.4.0 alpha1 plugin pack by the way. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anya.young at mtvi.com Tue Jan 13 19:01:01 2004 From: anya.young at mtvi.com (Young, Anya) Date: Tue Jan 13 19:01:01 2004 Subject: [Nagiosplug-devel] Email attachment Message-ID: Hello, I am writing a Perl plugin for nagios and need to send a log file with the detailed message as an attachment to the email notification. Is it possible to do and if yes could you please let me know what should I do for that. Thank you. Anya Serban. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mraus at evkhamm.de Tue Jan 13 19:01:02 2004 From: mraus at evkhamm.de (mraus at evkhamm.de) Date: Tue Jan 13 19:01:02 2004 Subject: [Nagiosplug-devel] New plugin Message-ID: <80ABC9E193A8D711B5C7003005029A2808D921@nts04.evkhamm.de> Hi list, following is a plugin that checks for digital snmp states. I am checking fans, doors, rooms (movement) and fire-sensors with it. Maybe it is of any use for you, too. Greetings, M.Raus Germany ---snip--- #! /bin/sh # # check_digital (uses check_snmp) # # This plugin checks a digital SNMP value. The user may define which numeric # value should be considered OK and which should be considered as critical. # Comparison is only done with the critical value. All other values are # taken to be non-critical. # # The user may also define strings to be returned on the OK and CRITICAL states. # # This plugin is usefull for checking doors, rooms, fire-sensors, lights, fans etc. # # Written by Michael H.Raus for KDT Systems Luenen Germany 01/2004 # PATH="" ECHO="/bin/echo" GREP="/bin/grep" DIFF="/usr/bin/diff" TAIL="/usr/bin/tail" CAT="/bin/cat" RM="/bin/rm" PROGNAME=`/bin/basename $0` PROGPATH=`echo $0 | /bin/sed -e 's,[\\/][^\\/][^\\/]*$,,'` REVISION=`echo '$Revision: 0.1 $' | /bin/sed -e 's/[^0-9.]//g'` . $PROGPATH/utils.sh print_usage() { echo "Usage: $PROGNAME -H -o -c -u -U " } print_help() { print_revision $PROGNAME $REVISION echo "" print_usage echo "" support } # Make sure the correct number of command line # arguments have been supplied if [ $# -lt 1 ]; then print_usage exit $STATE_UNKNOWN fi # Grab the command line arguments #logfile=$1 #oldlog=$2 #query=$3 exitstatus=$STATE_WARNING #default while test -n "$1"; do case "$1" in --help) print_help exit $STATE_OK ;; -h) print_help exit $STATE_OK ;; --version) print_revision $PROGNAME $VERSION exit $STATE_OK ;; -V) print_revision $PROGNAME $VERSION exit $STATE_OK ;; -H) hostadr=$2 shift ;; -o) oid=$2 shift ;; -u) userok=$2 shift ;; -U) usercrit=$2 shift ;; -c) critstate=$2 shift ;; *) echo "Unknown argument: $1" print_usage exit $STATE_UNKNOWN exit $STATE_OK ;; -H) hostadr=$2 shift ;; -o) oid=$2 shift ;; -u) userok=$2 shift ;; -U) usercrit=$2 shift ;; -c) critstate=$2 shift ;; *) echo "Unknown argument: $1" print_usage exit $STATE_UNKNOWN ;; esac shift done state=`check_snmp -H $hostadr -C public -o $oid` #echo ergebnis="$state" case "$state" in "SNMP OK - "$critstate) echo $usercrit exit $STATE_CRITICAL ;; *) echo $userok exit $STATE_OK ;; esac exit $exitstatus ---snap--- -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: InterScan_Disclaimer.txt URL: From Stanley.Hopcroft at IPAustralia.Gov.AU Tue Jan 13 19:01:02 2004 From: Stanley.Hopcroft at IPAustralia.Gov.AU (Stanley Hopcroft) Date: Tue Jan 13 19:01:02 2004 Subject: [Nagiosplug-devel] RFC on proposed ePN changes/Regression testing of Perl plugins. Message-ID: <20040114095608.C72067@IPAustralia.Gov.AU> Dear Gentlemen, Is anyone interested in checking the latest Perl plugins with 'usability' modifications to ePN (to wit, patches to p1.pl described below) ? It really needs someone with :- . an interest in Perl plugins . a test or production configuration against which the plugin set is _known_ to work. . hopefully an interest in ePN or the willingness to bring one up briefly. If anything this a good regression test since any plugins that generate warnings or errors at both compile and run time get booted with a message like tsitc> tail -1500 nagios.log | grep -i ePN [1073856915] SERVICE ALERT: firewall;Mainframe access via outsourced firewall;UNKNOWN;SOFT;1;**ePN 'check_mf' problem connecting to "202.14.186.30", port 23: connection timed-out at (eval 40) line 65 [1073862005] SERVICE ALERT: asterix;COMS ad-hoc check;UNKNOWN;SOFT;1;**ePN 'check_coms' Use of uninitialized value at (eval 54) line 219 [1073862065] SERVICE ALERT: asterix;COMS ad-hoc check;UNKNOWN;SOFT;2;**ePN 'check_coms' Use of uninitialized value at (eval 54) line 219 [1073862125] SERVICE ALERT: asterix;COMS ad-hoc check;UNKNOWN;HARD;3;**ePN 'check_coms' Use of uninitialized value at (eval 54) line 219 [1073934009] SERVICE ALERT: sapintranet;Web interface to SAP R3;UNKNOWN;SOFT;1;**ePN 'check_sapintranet' Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Dfa/MainframeSession.pm line 174, chunk -7 [1073934069] SERVICE ALERT: sapintranet;Web interface to SAP R3;UNKNOWN;HARD;2;**ePN 'check_sapintranet' Use of uninitialized value at /usr/local/lib/perl5/site_perl/5.005/Dfa/MainframeSession.pm line 174, chunk -7 tsitc> In all these cases, these erors represent shortcomings or faults in my own plugins. Yours sincerely. -- ------------------------------------------------------------------------ Stanley Hopcroft ------------------------------------------------------------------------ '...No man is an island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friend's or of thine own were. Any man's death diminishes me, because I am involved in mankind; and therefore never send to know for whom the bell tolls; it tolls for thee...' from Meditation 17, J Donne. More details/original RFC for testers. I am writing to invite those with embedded Perl Nagios (ePN) installations to consider, and or comment, and or test patches to the Perl component (p1.pl) intended to increase the usability of ePN by 1 (minor correction) return UNKNOWN for plugins that do not conform to plugin guidlelines by failing to call exit (either abend or by design) - formerly Nag would report CRITICAL 2 Logging run-time errors in the Nagios Log. eg tsitc> grep -i epn nagios.log [1072960109] SERVICE ALERT: asterix;J2EE Scheduler;UNKNOWN;SOFT;1;**ePN plugin 'check_scheduler' has syntax errors. Check ePN log. [1073100771] SERVICE ALERT: external;AUB search;UNKNOWN;SOFT;1;**ePN 'check_aub' syntax errors. Check ePN log. [1073100851] SERVICE ALERT: asterix;J2EE Scheduler;UNKNOWN;SOFT;1;**ePN 'check_scheduler' runtime error: Illegal division by zero at (eval 52) line 35. [1073281491] SERVICE ALERT: external;ATMOSS search;UNKNOWN;SOFT;1;**ePN 'check_atmoss' syntax errors. Check ePN log. [1073732647] SERVICE ALERT: external;ATMOSS search;UNKNOWN;SOFT;1;**ePN 'check_atmoss' Bareword found where operator expected at (eval 49) line 66, near "'http://external/atmoss/falcon.application_start : tsitc> 3 Logging the text that ePN actually runs on detection of a plugin syntax error eg [1073730787] **ePN 'ap5' error 'Global symbol "$ppp" requires explicit package name at (eval 23) line 15. ' in text " 0 1 package main; 2 use subs 'CORE::GLOBAL::exit'; 3 sub CORE::GLOBAL::exit { die "ExitTrap: $_[0] (Embed::ap5)"; } 4 package Embed::ap5; sub hndlr { 5 shift(@_); 6 @ARGV=@_; 7 local $^W=1; 8 #!/usr/bin/perl -w 9 10 use strict ; 11 12 # use diagnostics ; 13 14 $ppp = 0 ; # var name that is _unlikely_ to be used by other plugins. 15 16 while ($_ = shift @ARGV) { 17 # print "\$ARGV\[$ppp\]: $_ ; # NB embedded Perl only reads __1__ (one) line of output ! 18 print "\$ARGV\[$ppp\]: $_ " ; # NB embedded Perl only reads __1__ (one) line of output ! 19 $ppp++ ; 20 } 21 22 exit 0; # Like all plugins should do (otherwise, unknown [3] return status). 23 } 24 " As you can see, the text run by ePN is turned into a subroutine. This has consequences for plugin authors since there are other subtleties to be concerned about (eg closure retention of values) Plugin syntax errors are logged to a new log file, tentatively named /usr/local/nagios/var/epn.log 4 Plugins that generate warnings are _not_ run. This is a good idea since the basic ePN function is retain namespaces (stashes) containing globals and packages (modules). If the plugin is allowed to live, it may fail the first time but succeed the next time its run (after another plugin loads a module the first one needs, or worse set a global value that the first plugin should have set). Obviously this is confusing if not infuriating and dangerous. Apart from these changes 1 The operation, intent and style of p1.pl is largely retained. In particular the API is unchanged. There are _no_ changes to the Nag C code (at this stage). 2 Sites that are vigilant about the plugin standards are unlikely to notice any difference in behaviour. Be aware however that ePN covers not only plugins but _also_ Perl event handlers. 3 There is some docco and maybe some test code. A Perl version of mini_epn is also planned - about time I can hear many say. The modified p1.pl has been tested informally by me with 1 my production ePN (200 hosts/420 services) with FreeBSD 4.9/Perl 5.005 2 the mini_epn ePN simulator (/contrib) 3 a test Nag (hacked plugins/few checks/no alerts) with FreeBSD 4.9/Perl 5.8.0 Please note that these changes are designed to prevent - wierd ePN error messages being logged - anti-social ePN behaviour (alerts from a new buggy plugin) and to provide sysadmins and Perl plugin developers feedback about plugin execution by ePN. The patches do _not_ address the performance of ePN. They do _not_ 1 Deal with ePN memory leaks - my _informal_ testing shows that leak rate seems unchanged. 2 Make ePN faster (or slower - probably) Future changes however may increase the scope to include returning plugin output via the calls to Perl (dispensing with the file system method. This should speed things up a little and save Nag some sys IO calls). If there is someone out there waiting to write mod_nagios, I will shut up real quick but in the meantime you are stuck with someone that is learning - real slowly. If you are interested in receiving the patches, please write me privately. Note that although the changes are likely to be applied to Nag 2.0, this is a strictly private iniative that has nothing to do with the Nag core or Mr Galstad. As usual, it is on your own head, and don't blame Ethan. From noreply at sourceforge.net Wed Jan 14 01:58:03 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Jan 14 01:58:03 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-876708 ] check_smart.pl - Health-check S.M.A.R.T. disks Message-ID: New Plugins item #876708, was opened at 2004-01-14 10:57 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=876708&group_id=29880 Category: Perl plugin Group: None Status: Open Resolution: None Priority: 5 Submitted By: Roy Sigurd Karlsbakk (rkarlsba) Assigned to: Nobody/Anonymous (nobody) Summary: check_smart.pl - Health-check S.M.A.R.T. disks Initial Comment: check_smart interfaces with smartmontools and uses smartctl to check drives. It supports basic health (-H) checks and device type settings, including checking drives on a 3ware controller. Licensed under GPL. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=876708&group_id=29880 From Ton.Voon at egg.com Wed Jan 14 07:21:04 2004 From: Ton.Voon at egg.com (Voon, Ton) Date: Wed Jan 14 07:21:04 2004 Subject: [Nagiosplug-devel] Email attachment Message-ID: Young, Anya wrote: > Hello, > I am writing a Perl plugin for nagios and need to send a log file > with the detailed message as an attachment to the email notification. > Is it possible to do and if yes could you please let me know what > should I do for that. Thank you. > Anya Serban. I've copied this to nagios-users which is the more appropriate mailing list. If you are replying, please remove nagiosplug-devel. You can use the macros in Nagios in your email (see misccommands.cfg and the Nagios documentation). Any extra information outside of these macros will require some clever scripting. Ton This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. From daryl at introspect.net Thu Jan 15 12:01:03 2004 From: daryl at introspect.net (daryl at introspect.net) Date: Thu Jan 15 12:01:03 2004 Subject: [Nagiosplug-devel] check_snmp always shows critical Message-ID: <9C7A3E5A42361642983F68FF090D11F8022274@noc0.bmpc.int> Sorry if this has been covered before. I'm using v1.3.1, and have tested 1.4.0alpha1 with the same results. After adding some cisco-specific mibs to NET-SNMP on a Debian Woody system, the command: check_snmp -H -o .1.3.6.1.4.1.9.2.1.58.0 -w 85 -c 95 -C -l CPU -u % Returns: CPU WARNING - 5 % Removing the MIBs makes everything work just fine again. Interestingly, if I make the warn threshold or critical threshold below the actual value (with the MIBs in), I get: CPU WARNING - *5* % Note the *'s around the return value. Also confusing, it that snmpget returns: enterprises.9.2.1.58.0 = 5 No matter whether the MIBs are in or not (I didn't install anything that should cover this OID) The mibs installed are: BGP4-MIB-V1SMI.my CISCO-AAA-SERVER-MIB-V1SMI.my CISCO-CALL-TRACKER-MIB-V1SMI.my CISCO-CONFIG-MAN-MIB-V1SMI.my CISCO-DIAL-CONTROL-MIB-V1SMI.my CISCO-DLSW-MIB-V1SMI.my CISCO-DSP-MGMT-MIB-V1SMI.my CISCO-DSPU-MIB-V1SMI.my CISCO-ENVMON-MIB-V1SMI.my CISCO-GENERAL-TRAPS.my CISCO-HSRP-MIB-V1SMI.my CISCO-ISDN-MIB-V1SMI.my CISCO-POP-MGMT-MIB-V1SMI.my CISCO-REPEATER-MIB-V1SMI.my CISCO-RTTMON-MIB-V1SMI.my CISCO-SMI-V1SMI.my CISCO-SMI.my CISCO-SYSLOG-MIB-V1SMI.my CISCO-TC-V1SMI.my CISCO-TC.my CISCO-VOICE-COMMON-DIAL-CONTROL-MIB-V1SMI.my CISCO-VOICE-DIAL-CONTROL-MIB-V1SMI.my CISCO-VOICE-DNIS-MIB-V1SMI.my DIAL-CONTROL-MIB-V1SMI.my ENTITY-MIB-V1SMI.my INT-SERV-MIB-V1SMI.my ISDN-MIB-V1SMI.my MSDP-MIB-V1SMI.my OLD-CISCO-INTERFACES-MIB.my OLD-CISCO-SYSTEM-MIB.my OLD-CISCO-TCP-MIB.my OLD-CISCO-TS-MIB.my RFC1315-MIB.my RFC1406-MIB.my RSVP-MIB-V1SMI.my SNA-SDLC-MIB-V1SMI.my SNMP-REPEATER-MIB.my SNMPv2-SMI-V1SMI.my SNMPv2-TC-V1SMI.my SNMPv2-TC.my XGCP-MIB-V1SMI.my Any ideas? Daryl G. Jurbala BMPC Network Operations Tel (NY): +1 917 477 0468 x235 Tel (MI): +1 616 608 0004 x235 Tel (UK): +44 208 792 6813 x235 Fax: +1 508 526 8500 INOC-DBA: 26412*DGJ PGP Key: http://www.introspect.net/pgp From sghosh at sghosh.org Thu Jan 15 16:56:00 2004 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Thu Jan 15 16:56:00 2004 Subject: [Nagiosplug-devel] check_snmp always shows critical In-Reply-To: <9C7A3E5A42361642983F68FF090D11F8022274@noc0.bmpc.int> Message-ID: On Thu, 15 Jan 2004 daryl at introspect.net wrote: > Sorry if this has been covered before. I'm using v1.3.1, and have > tested 1.4.0alpha1 with the same results. > > After adding some cisco-specific mibs to NET-SNMP on a Debian Woody > system, the command: > > check_snmp -H -o .1.3.6.1.4.1.9.2.1.58.0 -w 85 -c 95 -C > -l CPU -u % > > Returns: > CPU WARNING - 5 % > > Removing the MIBs makes everything work just fine again. > > Interestingly, if I make the warn threshold or critical threshold below > the actual value (with the MIBs in), I get: > > CPU WARNING - *5* % > > Note the *'s around the return value. > > Also confusing, it that snmpget returns: > enterprises.9.2.1.58.0 = 5 > No matter whether the MIBs are in or not (I didn't install anything that > should cover this OID) > One of the cisco mibs is probably generating an ASN.1/SMI parsing error to snmpget. The parsing error is output on stderr for snmpget. Any output on stderr causes check_snmp to go to a "Warning" level. - try fixing the asn.1/smi error - use only numeric oids and prevent mibs files from being loaded by including a " -m : " option. -sg -- From noreply at sourceforge.net Sun Jan 18 12:09:02 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Jan 18 12:09:02 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-736655 ] Network printer status via snmp Message-ID: New Plugins item #736655, was opened at 2003-05-12 16:22 Message generated for change (Comment added) made by sghosh You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=736655&group_id=29880 Category: Network device plugin Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Subhendu Ghosh (sghosh) Assigned to: Subhendu Ghosh (sghosh) Summary: Network printer status via snmp Initial Comment: This plugin mirrors the functionality of the check_hpjd plugin and adds support for any network printers that support the PrinterMIB (rfc1759). It has been tested with Xerox N2125 and HP JetDirect 610N cards Only snmpv1/v2c is supported at this time. Bug reports to the nagiosplug-devel list please. ---------------------------------------------------------------------- >Comment By: Subhendu Ghosh (sghosh) Date: 2004-01-18 15:08 Message: Logged In: YES user_id=46572 added perf data support for page count under RFC support, plugin has been added to contrib directory. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=736655&group_id=29880 From noreply at sourceforge.net Tue Jan 20 14:02:02 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Jan 20 14:02:02 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-880904 ] check_mailq: -f option for sendmail config file Message-ID: Patches item #880904, was opened at 2004-01-20 22:01 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=880904&group_id=29880 Category: Enhancement Group: None Status: Open Resolution: None Priority: 5 Submitted By: Don Badrak (dbadrak) Assigned to: Nobody/Anonymous (nobody) Summary: check_mailq: -f option for sendmail config file Initial Comment: In my sendmail configuration, I have two instances of sendmail, with non-standard config files and spool directories. This is a patch to both check_mailq.pl and utils.pm.in that allows a -f options. The -f option is for sendmail only. It allows a non-standard configuration file to be used by the mailq command (mailq -C filename). It also looks through the config file for the QueueDirectory, and uses that, rather than assuming 'mqueue' will be in the string. I also included a fix in check_mailq.pl to ignore the case of the command line options (--warning vs --Warning). The patch for utils.pm.in is for a PATH_TO_SENDMAIL_CF. These patches are both against the HEAD revision. Don ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=880904&group_id=29880 From david at infotrek.co.uk Tue Jan 20 14:29:04 2004 From: david at infotrek.co.uk (David) Date: Tue Jan 20 14:29:04 2004 Subject: [Nagiosplug-devel] Patch to fix check_tcp memory allocation Message-ID: check_tcp was allocating 1 byte per server expect string pointer, instead of sizeof(char *) per pointer. Confirmed with electricfence with an alignment of 1 - a segfault occurs. The attached patch (against 1.3.1) fixes this problem. Please cc me on any response, I am not on this list. Cheers, David -- |> /+\ \| | |> David Croft Infotrek -------------- next part -------------- --- clean/nagios-plugins-1.3.1/plugins/check_tcp.c Tue Jun 10 00:56:47 2003 +++ plugins/check_tcp.c Tue Jan 20 03:10:25 2004 @@ -187,9 +187,9 @@ asprintf (&SERVICE, "NNTP"); SEND = NULL; EXPECT = NULL; - server_expect = realloc (server_expect, ++server_expect_count); + server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); asprintf (&server_expect[server_expect_count - 1], "200"); - server_expect = realloc (server_expect, ++server_expect_count); + server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); asprintf (&server_expect[server_expect_count - 1], "201"); asprintf (&QUIT, "QUIT\r\n"); PROTOCOL = TCP_PROTOCOL; @@ -209,7 +209,7 @@ /* use default expect if none listed in process_arguments() */ if (EXPECT && server_expect_count == 0) { - server_expect = malloc (++server_expect_count); + server_expect = malloc (sizeof (char *) * (++server_expect_count)); server_expect[server_expect_count - 1] = EXPECT; } @@ -447,9 +447,9 @@ case 'e': /* expect string (may be repeated) */ EXPECT = NULL; if (server_expect_count == 0) - server_expect = malloc (++server_expect_count); + server_expect = malloc (sizeof (char *) * (++server_expect_count)); else - server_expect = realloc (server_expect, ++server_expect_count); + server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); server_expect[server_expect_count - 1] = optarg; break; case 'm': From noreply at sourceforge.net Tue Jan 20 19:37:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Jan 20 19:37:01 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Feature Requests-881080 ] SIP Server Plugin Message-ID: Feature Requests item #881080, was opened at 2004-01-21 03:36 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397600&aid=881080&group_id=29880 Category: Interface Improvements (example) Group: Next Release (example) Status: Open Priority: 5 Submitted By: Paul Wasik (pwasik) Assigned to: Nobody/Anonymous (nobody) Summary: SIP Server Plugin Initial Comment: Would be nice to have built in support for monitoring SIP telephny server availability. This can be done by sending SIP OPTIONs messages to REGISTERED SIP devices like UAs, gateways, SIP proxy server, etc. There is a free SIP test tool called SipSak which can be incorporated into an external check to test SIP functionality. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397600&aid=881080&group_id=29880 From noreply at sourceforge.net Tue Jan 20 21:30:02 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Tue Jan 20 21:30:02 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Patches-881147 ] New check_overcr plugin by Greg Fleck Message-ID: Patches item #881147, was opened at 2004-01-21 05:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=881147&group_id=29880 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Ethan Galstad (egalstad) Assigned to: Nobody/Anonymous (nobody) Summary: New check_overcr plugin by Greg Fleck Initial Comment: This is an updated check_overcr plugin submitted by Greg Fleck. His notes on the changes made to the plugin follow: I made some changes to the attached files... The main goal was to receive additional disk information in nagios. The primary functionality is intact.. check_overcr.c (A few more changes here) added DF command (DPU v2) to parse information... Returns: DISK OK - 86% used on /dev/sda1 (T:783G,U:672G,F:111G) removed output message parts "ok" and "problem" with "OK", "WARRING", and "CRITICAL" so the out put messages would look something like: DISK OK - 86% used on /dev/sda1 (T:783G,U:672G,F:111G) DISK WARNING - 86% used on /dev/sda1 (T:783G,U:672G,F:111G) DISK CRITICAL- 86% used on /dev/sda1 (T:783G,U:672G,F:111G) for example. The reason for this change was that NAGIOS had problem parsing the output. Please forgive the coding. I am not a great C or perl writer.... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397599&aid=881147&group_id=29880 From karl at debisschop.net Wed Jan 21 04:54:02 2004 From: karl at debisschop.net (Karl DeBisschop) Date: Wed Jan 21 04:54:02 2004 Subject: [Nagiosplug-devel] Patch to fix check_tcp memory allocation In-Reply-To: References: Message-ID: <1074689434.3594.3.camel@miles> On Tue, 2004-01-20 at 03:12, David wrote: > check_tcp was allocating 1 byte per server expect string pointer, instead > of sizeof(char *) per pointer. Confirmed with electricfence with an > alignment of 1 - a segfault occurs. > > The attached patch (against 1.3.1) fixes this problem. > > Please cc me on any response, I am not on this list. patch applied to HEAD and tsbale branches. Thanks. -- Karl From noreply at sourceforge.net Wed Jan 21 12:22:01 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Jan 21 12:22:01 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Feature Requests-881670 ] Wildcarding option in use of '-x' switch Message-ID: Feature Requests item #881670, was opened at 2004-01-21 15:21 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397600&aid=881670&group_id=29880 Category: None Group: None Status: Open Priority: 5 Submitted By: Martin Gignac (lmcgign) Assigned to: Nobody/Anonymous (nobody) Summary: Wildcarding option in use of '-x' switch Initial Comment: I was wondering if there any plans to include the possibility of wildcarding filesystems with '*' for example when using the '-x' switch. For example, when mounting a Solaris install CD on a Solaris box, the Solaris CD automounter creates six distinct "mount points" automatically. These mount points are dynamic and contain (among other things) the name of the CD. For example: /cdrom/solaris_8_hw1001_sparc/s0 /cdrom/solaris_8_hw1001_sparc/s1 /cdrom/solaris_8_hw1001_sparc/s2 /cdrom/solaris_8_hw1001_sparc/s3 /cdrom/solaris_8_hw1001_sparc/s4 and /cdrom/solaris_8_hw1001_sparc/s5 are all new mount points created when CD X is entered. If another CD is entered, then the mount point name after the '/cdrom/' will change, making it hard to exclude these "moving target" filesystems. And since a CD-ROM file system always shows up as 0% free, a CRITICAL event is generated by the plugin as soon as a CD is inserted in the SUN box. Excluding a filesystem type will not work either as 's0' shows up as 'hsfs' and the rest all show up as 'ufs' Excludng 'ufs' would pretty much eliminate checks on all Solaris partitions while eliminating 'hsfs' still leaves the other s1-s5 partitions (some of which are at 98% full) and that still generates an alarm. If wildcarding could be done with the '-p' switch, such as: check_disk -w 20% -c 20% -x "/cdrom/*" this would prevent any CD from being checked. Regards, -Martin ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397600&aid=881670&group_id=29880 From david at infotrek.co.uk Wed Jan 21 20:25:01 2004 From: david at infotrek.co.uk (David) Date: Wed Jan 21 20:25:01 2004 Subject: [Nagiosplug-devel] Patch to fix check_tcp memory allocation Message-ID: check_tcp was allocating 1 byte per server expect string pointer, instead of sizeof(char *) per pointer. Confirmed with electricfence with an alignment of 1 - a segfault occurs. The attached patch (against 1.3.1) fixes this problem. Please cc me on any response, I am not on this list. Cheers, David -- |> /+\ \| | |> David Croft Infotrek -------------- next part -------------- --- clean/nagios-plugins-1.3.1/plugins/check_tcp.c Tue Jun 10 00:56:47 2003 +++ plugins/check_tcp.c Tue Jan 20 03:10:25 2004 @@ -187,9 +187,9 @@ asprintf (&SERVICE, "NNTP"); SEND = NULL; EXPECT = NULL; - server_expect = realloc (server_expect, ++server_expect_count); + server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); asprintf (&server_expect[server_expect_count - 1], "200"); - server_expect = realloc (server_expect, ++server_expect_count); + server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); asprintf (&server_expect[server_expect_count - 1], "201"); asprintf (&QUIT, "QUIT\r\n"); PROTOCOL = TCP_PROTOCOL; @@ -209,7 +209,7 @@ /* use default expect if none listed in process_arguments() */ if (EXPECT && server_expect_count == 0) { - server_expect = malloc (++server_expect_count); + server_expect = malloc (sizeof (char *) * (++server_expect_count)); server_expect[server_expect_count - 1] = EXPECT; } @@ -447,9 +447,9 @@ case 'e': /* expect string (may be repeated) */ EXPECT = NULL; if (server_expect_count == 0) - server_expect = malloc (++server_expect_count); + server_expect = malloc (sizeof (char *) * (++server_expect_count)); else - server_expect = realloc (server_expect, ++server_expect_count); + server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); server_expect[server_expect_count - 1] = optarg; break; case 'm': From wudda at hotmail.com Wed Jan 21 20:25:02 2004 From: wudda at hotmail.com (Chris) Date: Wed Jan 21 20:25:02 2004 Subject: [Nagiosplug-devel] =?utf-8?b?Y2hlY2tfbG9n?= plugin Message-ID: hello i'm trying to run the check_log plugin on a Solaris 2.8 install, everytime i run it i get ./check_log.sh: test: argument expected when i run it on a freebsd box it works as expected. the problem is that it HAS to be run on solaris.. has anyone run across this? thanks. From sghosh at sghosh.org Wed Jan 21 20:42:02 2004 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Wed Jan 21 20:42:02 2004 Subject: [Nagiosplug-devel] =?utf-8?b?Y2hlY2tfbG9n?= plugin In-Reply-To: Message-ID: On Tue, 20 Jan 2004, Chris wrote: > hello > > > > i'm trying to run the check_log plugin on a Solaris 2.8 install, everytime i run > > it i get > > ./check_log.sh: test: argument expected > > when i run it on a freebsd box it works as expected. the problem is that it HAS > > to be run on solaris.. has anyone run across this? Does the Solaris box have the following installed? ECHO="/bin/echo" GREP="/bin/grep" DIFF="/usr/bin/diff" TAIL="/usr/bin/tail" CAT="/bin/cat" RM="/bin/rm" -- -sg From noreply at sourceforge.net Thu Jan 22 04:49:02 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Jan 22 04:49:02 2004 Subject: [Nagiosplug-devel] [ nagiosplug-New Plugins-882097 ] check_swap.pl Message-ID: New Plugins item #882097, was opened at 2004-01-22 13:48 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=882097&group_id=29880 Category: Perl plugin Group: None Status: Open Resolution: None Priority: 5 Submitted By: Roy Sigurd Karlsbakk (rkarlsba) Assigned to: Nobody/Anonymous (nobody) Summary: check_swap.pl Initial Comment: New check_swap plugin for Linux written in perl. The old one didn't support Linux 2.6. This does :) roy ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=541465&aid=882097&group_id=29880 From noreply at sourceforge.net Thu Jan 22 12:28:04 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Thu Jan 22 12:28:04 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-882381 ] check_breeze compile failure Message-ID: Bugs item #882381, was opened at 2004-01-22 11:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=882381&group_id=29880 Category: Parsing problem Group: v1.3.0 beta3 Status: Open Resolution: None Priority: 5 Submitted By: Jason Martin (jhmartin) Assigned to: Nobody/Anonymous (nobody) Summary: check_breeze compile failure Initial Comment: >From the 1.3.1 check-breeze: ./check_breeze Global symbol "$opt_C" requires explicit package name at ./check_breeze line 26. Global symbol "$opt_C" requires explicit package name at ./check_breeze line 26. Global symbol "$opt_C" requires explicit package name at ./check_breeze line 47. Global symbol "$opt_C" requires explicit package name at ./check_breeze line 47. Global symbol "$opt_C" requires explicit package name at ./check_breeze line 50. Execution of ./check_breeze aborted due to compilation errors. I believe the problem is that opt_C is not specified in: use vars qw($opt_V $opt_h $opt_H $opt_w $opt_c $PROGNAME); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=882381&group_id=29880 From barber2 at llnl.gov Mon Jan 26 07:32:06 2004 From: barber2 at llnl.gov (Karl N. Barber) Date: Mon Jan 26 07:32:06 2004 Subject: [Nagiosplug-devel] check_ntp Message-ID: <5.0.0.25.2.20040123095818.00a70bc0@popcorn.llnl.gov> Am having problems with check_ntp. version is 1.19 The output is as follows: ./check_ntp -help Bareword "utils" not allowed while "strict subs" in use at ./check_ntp line 65. Bareword "pm" not allowed while "strict subs" in use at ./check_ntp line 65. BEGIN not safe after errors--compilation aborted at ./check_ntp line 66. From glebius at cell.sick.ru Mon Jan 26 07:32:07 2004 From: glebius at cell.sick.ru (Gleb Smirnoff) Date: Mon Jan 26 07:32:07 2004 Subject: [Nagiosplug-devel] check_radius problem Message-ID: <20040125180816.GA39282@cell.sick.ru> Dear sirs, I have a problem running check_radius plugin: it works fine from root shell, but it returns "Auth Error" if run from non-root shell. Tcpdump show no outgoing request in latter case. Certainly, the plugin does not work under Nagios. Here it is: glebius at fade:~:|>/usr/local/libexec/nagios/check_radius -v -H localhost -P 1812 -F /usr/local/etc/radiusclient/radiusclient.conf -u ppptest -p test Auth Errorglebius at fade:~:|> root at fade:/usr/local/etc/nagios:|>/usr/local/libexec/nagios/check_radius -H 217.72.144.3 -P 1812 -F /usr/local/etc/radiusclient/radiusclient.conf -u ppptest -p test Auth OKroot at fade:/usr/local/etc/nagios:|> P.S.: Please Cc: me, because I'm not subscribed! -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE From sghosh at sghosh.org Mon Jan 26 16:25:17 2004 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Mon Jan 26 16:25:17 2004 Subject: [Nagiosplug-devel] check_ntp In-Reply-To: <5.0.0.25.2.20040123095818.00a70bc0@popcorn.llnl.gov> Message-ID: On Fri, 23 Jan 2004, Karl N. Barber wrote: > Am having problems with check_ntp. > version is 1.19 > The output is as follows: > > ./check_ntp -help > Bareword "utils" not allowed while "strict subs" in use at ./check_ntp line 65. > Bareword "pm" not allowed while "strict subs" in use at ./check_ntp line 65. > BEGIN not safe after errors--compilation aborted at ./check_ntp line 66. > While it is a perl script, it is a part of the distribution and needs to run thru configure and make in order to set useful path and paramters... Looks like your instance has not been... the "use lib utils.pm" line should be transformed into: use lib /path/to/nagios/libexec/utils.pm; -- -sg From sghosh at sghosh.org Mon Jan 26 16:30:17 2004 From: sghosh at sghosh.org (Subhendu Ghosh) Date: Mon Jan 26 16:30:17 2004 Subject: [Nagiosplug-devel] check_ntp: NTP vs SNTP Message-ID: Q. Is anybody using check_ntp to test sync against MS w32time SNTP service? Since w32time SNTP cannot/does not respond to peer association requests, I am pondering the possiblity to adding a -S option to check_ntp to bypass the call to ntpq for peer association. Possible side affect - avoid calling ntpdate -q for full fledges NTP servers since they respond to peer association status. Any comments? -- -sg From ryer at schneider.com Tue Jan 27 11:05:31 2004 From: ryer at schneider.com (Ralph Rye) Date: Tue Jan 27 11:05:31 2004 Subject: [Nagiosplug-devel] =?utf-8?b?Y2hlY2tfcHJvY3M=?= 1.4.0alpha1 Message-ID: Not sure if this the correct forum for this, but I am attempting to test the 1.40alpha1 on AIX 5L. It works fine on most of machines, but on my WAS servers whree the command line agruments consume up to 2045 chars I get a segmentation fault. By looking at the code, I believe I see the problem that the MAX_INPUT_BUFFER is defined at 1024. By changing this to 2048 for the check_procs program, everything works fine. Please let me know if I should post this info somewhere else... Thanks, Ralph From Ton.Voon at egg.com Wed Jan 28 01:08:03 2004 From: Ton.Voon at egg.com (Voon, Ton) Date: Wed Jan 28 01:08:03 2004 Subject: [Nagiosplug-devel] check_procs 1.4.0alpha1 Message-ID: Ralph, Thanks for the report. Probably best to raise a bug in Sourceforge so we don't lose this in the email forest. Looks like MAX_INPUT_BUFFER is used by lots of different plugins. I'll leave it to one of the other developers to make the decision on whether this should be increased. Ton -----Original Message----- From: Ralph Rye [mailto:ryer at schneider.com] Sent: Tuesday, January 27, 2004 6:54 PM To: nagiosplug-devel at lists.sourceforge.net Subject: [Nagiosplug-devel] check_procs 1.4.0alpha1 Not sure if this the correct forum for this, but I am attempting to test the 1.40alpha1 on AIX 5L. It works fine on most of machines, but on my WAS servers whree the command line agruments consume up to 2045 chars I get a segmentation fault. By looking at the code, I believe I see the problem that the MAX_INPUT_BUFFER is defined at 1024. By changing this to 2048 for the check_procs program, everything works fine. Please let me know if I should post this info somewhere else... Thanks, Ralph This private and confidential e-mail has been sent to you by Egg. The Egg group of companies includes Egg Banking plc (registered no. 2999842), Egg Financial Products Ltd (registered no. 3319027) and Egg Investments Ltd (registered no. 3403963) which carries out investment business on behalf of Egg and is regulated by the Financial Services Authority. Registered in England and Wales. Registered offices: 1 Waterhouse Square, 138-142 Holborn, London EC1N 2NA. If you are not the intended recipient of this e-mail and have received it in error, please notify the sender by replying with 'received in error' as the subject and then delete it from your mailbox. From noreply at sourceforge.net Wed Jan 28 08:25:11 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Wed Jan 28 08:25:11 2004 Subject: [Nagiosplug-devel] [ nagiosplug-Bugs-886325 ] check_procs 1.40alpha1 Message-ID: Bugs item #886325, was opened at 2004-01-28 10:24 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=886325&group_id=29880 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Ralph Rye (norgetek) Assigned to: Nobody/Anonymous (nobody) Summary: check_procs 1.40alpha1 Initial Comment: On AIX 5L the maximum command agruments display with a ps command appears to be 2045 chars. When using the check_procs on a WebSphere application server, the check_procs segementation faults. I mod'd the MAX_INPUT_BUFFER variable to 2048 and recompiled the check_procs binary and every thing works fine. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=397597&aid=886325&group_id=29880 From bwhaley at costrack.com Wed Jan 28 09:10:18 2004 From: bwhaley at costrack.com (Ben Whaley) Date: Wed Jan 28 09:10:18 2004 Subject: [Nagiosplug-devel] check_ssh and check_smtp return codes Message-ID: Greetings all, I didn't want to submit this as a bug report yet, God knows I've been wrong before.. Most mornings when I get to work I see errors on the console that say: Segmentation Fault - core dumped Warning: Return code of 139 for check of service 'SSH Check' on host 'ucsub' was out of bounds. Sometimes this error is for SMTP checks instead of ssh checks. Anyway, examining the code has led me to a couple of possibilities. check_ssh and check_smtp open a tcp connection in the same way: result = my_tcp_connect (...); The result is then examined for STATE_OK, otherwise both check_ssh and check_smtp 'return result'. After looking into what my_tcp_connect can return (from netutils.c), it looks as though it can only return STATE_UNKNOWN, STATE_CRITICAL, and STATE_OK. I see nothing that would make it return 139. However, when I changed the 'return result' (when result != STATE_OK after calling my_tcp_connect) to 'return UNKNOWN', the problem disappeared. This indicates that it may be a bug in netutils.c. The relevant lines are ~99 in check_smtp.c and ~197 in check_ssh.c. The other possibility is on the Nagios end. I briefly checked into that and, if it is a Nagios problem, it would be in checks.c. I didn't spend a lot of time digging there. I hope this makes at least some sense. Regards, Ben Whaley From bjornar.bjorgum.larsen at ementor.no Fri Jan 30 23:31:03 2004 From: bjornar.bjorgum.larsen at ementor.no (=?iso-8859-1?Q?Bj=F8rnar_Bj=F8rgum_Larsen?=) Date: Fri Jan 30 23:31:03 2004 Subject: [Nagiosplug-devel] check_ssh and check_smtp return codes Message-ID: > Most mornings when I get to work I see errors on the console that say: > > Segmentation Fault - core dumped > Warning: Return code of 139 for check of service 'SSH > Check' on host > 'ucsub' was out of bounds. I don't know about the segfault part, bur usually when we see "Return code xyz was out of bounds" it means that the string returned to Nagios was too long for Nagios to handle. Technically this is a check bug, since the checks should conform to Nagios specifications, but in my humble opinion Nagios should be able to handle all string lengths, at the very least it could truncate. I've read something about it on nagios.org or in the mailing lists, I think it's fixed in 2.0 or in the pipeline. Until then, I'm patching the checks so that they don't return long error messages no matter what they encounter. :) Bj?rnar From Stanley.Hopcroft at IPAustralia.Gov.AU Sat Jan 31 08:05:03 2004 From: Stanley.Hopcroft at IPAustralia.Gov.AU (Stanley Hopcroft) Date: Sat Jan 31 08:05:03 2004 Subject: [Nagiosplug-devel] Nice stuff been done with the Perl plugins. Message-ID: <20040129205756.C234@IPAustralia.Gov.AU> Dear Gentlemen, I am writing to congratulate you on the elegance with which the Perl plugins have dealt with the troublesome matter of finding executables for n plugins. Placing the paths to binaries as package globals in utils:: is a good idea and one that I think solves this problem wonderfully. Nice job. Yours sincerely. -- ------------------------------------------------------------------------ Stanley Hopcroft ------------------------------------------------------------------------ '...No man is an island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friend's or of thine own were. Any man's death diminishes me, because I am involved in mankind; and therefore never send to know for whom the bell tolls; it tolls for thee...' from Meditation 17, J Donne. From Stanley.Hopcroft at IPAustralia.Gov.AU Sat Jan 31 08:05:05 2004 From: Stanley.Hopcroft at IPAustralia.Gov.AU (Stanley Hopcroft) Date: Sat Jan 31 08:05:05 2004 Subject: [Nagiosplug-devel] ePN Regression testing of subset of Perl plugin-scripts from 1.4.0alpha1 tarball on SourceForge. Message-ID: <20040129205319.B234@IPAustralia.Gov.AU> Dear Gentlemen, Part of the testing hacking for the forthcoming Nagios::Persistence CPAN module (yes a 'module' for p1.pl seems the only way to maintain it) has included running an ePN simulator against a subset of the Perl plugins from the forthcoming release. You can see the results below, as well as the driver script (eventually to be part of the module). My analysis is 1 Successfull ePN plugins are check_mailq check_ntp 2 Unsuccessfull ePN plugins are check_disk_smb 3 Dubious => simulation is inaccurate check_rpc Notes. check_disk_smb fails because it uses 'shift' as Perl vernacular for 'shift @ARGV'. This does not work in an ePN since the plugin is turned into a subroutine and therefore Perl interprets 'shift' as 'shift @_'. I don't know why check_rpc fails after the first attempt. This is usually an indication of name space pollution by either globals/use vars or a closure effect. If you want to try this yourselves, hopefully with the other plugins, then you need p1.pl from the Nag HEAD branch (p1.pl is still volatile but the focus is on POD not internals). Since this code is all in .pl land you can enjoy using a nice debugger to find out why check_rpc is behaving so unreasonably. I hope to pursue this (The C mini_epn is still being maintained but this more fun). WARNING WARNING WARNING ! Attempting to run the driver/simulator below with a p1.pl from Nagios 1.x will only result in unhappiness since the plugin output will _not_ be returned to the driver. Yours sincerely. -- ------------------------------------------------------------------------ Stanley Hopcroft ------------------------------------------------------------------------ '...No man is an island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friend's or of thine own were. Any man's death diminishes me, because I am involved in mankind; and therefore never send to know for whom the bell tolls; it tolls for thee...' from Meditation 17, J Donne. 1 Results of repeated ePN run attempts of plugin subset (I am hooked on an old version of Net::SNMP because I run 5.005_03 so updating is not possible until Net::SNMP accomodates venerable P5 installations). tsitc> ./drive_epn_loop.pl check_rpc (0, OK: RPC program portmapper version 2 udp running). check_ntp (0, NTP OK: Offset -0.000001 secs, jitter 0.433 msec, peer is stratum 1). check_disk_smb (3, Invalid warning threshold: -H). check_mailq (0, OK: mailq is empty|unsent=0;5;10;0). check_rpc (3, UNKNOWN: RPC program portmapper udp is not running). check_ntp (0, NTP OK: Offset -0.000002 secs, jitter 0.433 msec, peer is stratum 1). check_disk_smb (3, Invalid warning threshold: -H). check_mailq (0, OK: mailq is empty|unsent=0;5;10;0). check_rpc (3, UNKNOWN: RPC program portmapper udp is not running). check_ntp (0, NTP OK: Offset -0.000001 secs, jitter 0.433 msec, peer is stratum 1). check_disk_smb (3, Invalid warning threshold: -H). check_mailq (0, OK: mailq is empty|unsent=0;5;10;0). check_rpc (3, UNKNOWN: RPC program portmapper udp is not running). check_ntp (0, NTP OK: Offset -0.000001 secs, jitter 0.433 msec, peer is stratum 1). check_disk_smb (3, Invalid warning threshold: -H). check_mailq (0, OK: mailq is empty|unsent=0;5;10;0). ^C tsitc> 2 Driver code. Note that p1.pl must be in the same path as this code and the plugins (although you can put in a plugin path if you want to) #!/usr/bin/perl # NB -w| $^W = 1 makes _every_ standard plugin fail (variable # $PROGNAME will not stay shared). # $Id$ # $Log$ use strict ; require 'p1.pl' ; my @cmdlines = ; while (1) { foreach my $cmd_line (@cmdlines) { chomp($cmd_line) ; my ($plugin_file, $argv) = split(/\s+/, $cmd_line, 2) ; eval { # 'eval {}' simulates the G_EVAL flag to perl_call_argv('code', 'flags') # Otherwise, die in 'eval_file' will end the caller also. Embed::Persistent::eval_file($plugin_file, 0) ; } ; # don't care about $@ since it will be passed by eval_file to run_package my ($rc, $output) = Embed::Persistent::run_package($plugin_file, 0, '', $argv) ; chomp $output ; print $plugin_file, "\t($rc, $output).\n" ; sleep 5 ; } } exit 0 ; __DATA__ check_rpc -H localhost -C portmapper check_ntp -H localhost check_disk_smb -H cbrnas01 -s anwsmh$ -u anwsmh -p Fgsltwhg6 -W ipaustralia check_mailq -w 5 -c 10 From bebe_pardo99 at hotmail.com Sat Jan 31 08:05:06 2004 From: bebe_pardo99 at hotmail.com (Cesar Pech) Date: Sat Jan 31 08:05:06 2004 Subject: [Nagiosplug-devel] Hi Need Help Message-ID: Hi, i'm new user for Nagios, i have a problem with a check_ping plugin, in the console i write this instrunction: ./check_ping -H 200.79.231.17 -w 100,20% -c 500,60% and then show me this problem: /bin/ping -n -U -c 5 200.79.231.17 Error: Could not interpret output from ping command what is the problem here? can you help me? _________________________________________________________________ MSN. M?s ?til Cada D?a http://www.msn.es/intmap/ From anwsmh at IPAustralia.Gov.AU Thu Jan 1 03:54:09 2004 From: anwsmh at IPAustralia.Gov.AU (Stanley Hopcroft) Date: Thu, 1 Jan 2004 13:54:09 +1100 Subject: No subject Message-ID: Dear Ladies and Gentlemen, I am writing to request your comments on proposed changes to the embedded Perl interpreter support in Nagios (ePN). This letter has two sections: part A is general discussion and the proposals; B concerns testing. Part A Discussion and Proposals. The ePN support contributed by Mr Stephen Davies embeds a Perl interpreter into the Nagios binary and (with much cleverness) allows Perl plugins to be compiled only once before they are run (as well as letting the Plugin call the Perl exit without trashing the interpreter; saving the output the plugin writes to STDOUT and other good things) ePN provides these benefits to Perl plugins and Nagios 1 Perl plugins are not subject to the OS forking the Nagios process; Perl plugins are called as Nagios functions While Nagios forks to execute _each_ plugin, an ePN Nagios does not request another fork (in the popen() system call) to run the plugin. 2 Perl plugins are compiled only once, saving both an exec of the Perl interpreter and the Perl compilation phase (to the Perl op-code parse tree) each time a Perl plugin is run. Since the compilation phase may include loading Perl modules required by the plugin (some of which are huge), there is quite a saving or work if not execution time (since Perl is pretty fast) in single compilation. There are also ePN tradeoffs such as markedly increased memory consumption (the Perl parse trees remain in memory). The ePN implementation that has performed well in both Netsaint 0.0.[4-7] and Nagios 1.[0-1] and it seems to be remains unchanged in the HEAD CVS branch (the Perl calls in the head checks.c seem to be the same as those in 1.x, and p1.pl appears unchanged), could be enhanced in these areas 1 Performance Three observations concerned with performance are that 1.1 The plugin output is returned to Nagios through the file system (rather than as an extra element of a list returned by Embed::Persistent::run_plugin). Instead of STDOUT being tied to the file system it could be tied to an in memory data structure (probably scalar) and the value the plugin 'writes' as output returned as an extra element on the Perl stack. This I think is a straight forward enhancement that saves Nagios system calls to generate a temporary file name, open the file, read the line of plugin output and unlink the file. Unfortunately, I don't know why STDOUT was tied to a file: it doesn't seem to have any debugging advantages because the contents are either logged by Nag (and the file unlinked) or there are _no_ contents. 1.2 The ePN author comments specifically on the separation of the parse and execution phases ' # Only major changes are to separate the compiling and cacheing from # the execution so that the cache can be kept in "non-volatile" parent # process while the execution is done from "volatile" child processes ' Unfortunately, I dnn't understand this (presumably the 'processes' are the eval_file and run_package subroutines in the Embed::Persistent package. However, while eval_file is only concerned whether to parse the plugin, the data structure that it uses to avoid reparsing unchanged plugins that have already been compiled (%Cache) is an entry in the package symbol table: it is visible to both subroutines). It _may_ be better to replace the two Nagios calls to Perl (one for eval_file and the other for run_package) by one call to a new Perl subroutine that optionally compiles and runs the plugin. This change is extensive; I have no plans to do so immediately if at all. 1.3 p1.pl uses IO::File to open the file to which plugin output is sent. IO::File is a big module (according to Lincoln Stein) and in this case where it is only being used to return a file handle glob, it seems overkill. Unfortunately, replacing it by a normal two argument Perl open produces a wierd failure in _all_ the Perl plugins. *** no longer relevant *** IO::File can be ignored. In view of 1.1 this doesn't seem worth worrying about. 2 Usability Coding plugins to succeed under ePN requires more Perl nouse and experience than without ePN: the same plugin can run from the command line but fail with ePN. The ePN support can be enhanced to provide information useful to the plugin developer and to avoid spurious CRITICAL states (caused by plugin mistakes) by 2.1 Logging Perl warnings and compile time errors 2.2 Logging (in the Nagios log file) a clear indication that the plugin has failed and at the same time returning UNKNOWN instead of CRITICAL when a plugin cannot be executed. Here is an extract from a test Nagios nagios.log running with ePN support that provides such logging [1072870185] SERVICE ALERT: oradev;AUB;UNKNOWN;SOFT;1;**ePN plugin runtime error: Can't locate object method "new" via package "Nagios::WebTransact" at (eval 1) line 79 in plugin 'check_aub'. [1072870245] SERVICE ALERT: oradev;AUB;UNKNOWN;SOFT;2;**ePN plugin runtime error: Can't locate object method "new" via package "Nagios::WebTransact" at (eval 1) line 79 in plugin 'check_aub'. [1072870275] SERVICE ALERT: oradev;bad_plugin;UNKNOWN;SOFT;1;**ePN plugin 'ap5' has syntax errors. Check ePN log. [1072870305] SERVICE ALERT: oradev;AUB;UNKNOWN;HARD;3;**ePN plugin runtime error: Can't locate object method "new" via package "Nagios::WebTransact" at (eval 1) line 79 in plugin 'check_aub'. [1072870335] SERVICE ALERT: oradev;bad_plugin;UNKNOWN;SOFT;2;**ePN plugin 'ap5' has syntax errors. Check ePN log. [1072870395] SERVICE ALERT: oradev;bad_plugin;UNKNOWN;HARD;3;**ePN plugin 'ap5' has syntax errors. Check ePN log. These errors signify that 1 the plugin named check_aub would compile but had a fatal run-time error ( Hardly suprising since it was hacked for this purpose tsitc> diff -c ../libexec/check_aub /usr/local/nagios/libexec/check_aub *** ../libexec/check_aub Wed Dec 31 12:20:33 2003 --- /usr/local/nagios/libexec/check_aub Sat Jun 21 11:15:51 2003 *************** *** 30,36 **** use Getopt::Long; ! # use Nagios::WebTransact ; use utils qw($TIMEOUT %ERRORS &print_revision &support); my $PROGNAME = 'check_aub' ; --- 30,36 ---- use Getopt::Long; ! use Nagios::WebTransact ; use utils qw($TIMEOUT %ERRORS &print_revision &support); my $PROGNAME = 'check_aub' ; tsitc> ) 2 The plugin named 'ap5' failed to compile under the ePN Here is the corresponding entry in the new ePN log of plugin syntax errors. tsitc> tail -30 epn.log **ePN plugin syntax error: Global symbol "$i" requires explicit package name at (eval 3) line 5. in package Embed::Persistent file /home/anwsmh/nagios-1.0_test-debug/bin/p1.pl at line 144 in text " package main; use subs 'CORE::GLOBAL::exit'; sub CORE::GLOBAL::exit { die "ExitTrap: $_[0] (Embed::ap5)"; } package Embed::ap5; sub hndlr { shift(@_); @ARGV=@_; #!/usr/bin/perl -w use strict ; $i = 0 ; while ($_ = shift @ARGV) { print "\$ARGV\[$i\]: $_ " ; # NB embedded Perl only reads __1__ (one) line of output ! $i++ ; } ; } ;". tsitc> This shows the complete plugin listing _as it is executed by ePN (the original plugin text is wrapped as a subroutine with the exit method overridden); the line number reported as the line containing the error (5) is wrt to the _original_ plugin text. The usability changes are 1 comprised of patches to p1.pl solely 2 change the exit status of a plugin with a run time error from CRITICAL to UNKNOWN (this was obviously a minor mistake in the original p1.pl) 3 change the message logged for a plugin with a run time error from (No output!) to **ePN plugin runtime error: Can't locate object method "new" via package "Nagios::WebTransact" at (eval 1) line 79 in plugin 'check_aub'. and 4 change the the message logged for a plugin with a syntax error from (No output!) to *ePN plugin 'ap5' has syntax errors. Check ePN log. 5 add an ad-hoc log to p1.pl to record plugin syntax errors. At the moment this log file is specified by a hard coded string in p1.pl that re-opens STDERR in append mode to that file. The CPAN Sys::Syslog module could be be used to allow syslogd to rotate and archive but I think this an unacceptably memory tradeoff. B Testing I have patched p1.pl (the version I think is 1.2 from both 1.x and 2.x CVS branches) to implement the usability changes above (and will also do so for the first of the performance changes [don't use file system to return plugin output]) and used it successfully on _one_ FreeBSD system (system Perl 5.005_03) for 1 My production Nag (200 hosts/400 services/"if it's not pinged it's Perl'd"), only for about 24 hours at this stage. 2 A test Nag (same host/Perl - tiny config, hacked plugins, different paths) for adhoc testing. 3 ePN simulator (same host/Perl) I will try on at least a Linux/threaded Perl system before asking for testers. Since these changes have the potential to . creep into the Nagios C code (almost certainly will. NB I think the changes are confined to checks.c but any part of the code that contains #ifdef EMBEDDEDPERL potentially needs changing) . create havoc (see 1.3 under Performance) I welcome any comments and particuarly those about testing. At this stage my plan is to . allow the usability changes more time to misbehave (as well as trying them on a Linux test system - mini config) *** been in production for 2-3 months **** . try the more extensive performance change (1.1) as above - since this is the only one of the changes that really is helpful to Nagios ePN installations. . Invite testers - preferably from experienced sysadmins/entropy removalists . submit patches. *** done but I can't recall for what and to what *** Yours sincerely. -- ------------------------------------------------------------------------ Stanley Hopcroft ------------------------------------------------------------------------ '...No man is an island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friend's or of thine own were. Any man's death diminishes me, because I am involved in mankind; and therefore never send to know for whom the bell tolls; it tolls for thee...' from Meditation 17, J Donne.