[Nagiosplug-devel] Patch for check_snmp.c

Mayhew, Andrew amayhew at verisign.com
Thu Aug 1 10:11:44 CEST 2002


I hadn't really considered making it a command line switch, because in my
few it was a consistency issue.  By having the snmpget information always in
the return, then I can go through and parse out the values to feed into an
rrd-based graphing tool to get trending beyond just up-and-down for the
service being checked.  

If I do get around to adding this as a command line argument, I'll probably
add that and a switch to ignore stderr output from snmpget, since the
current code puts the return in a WARNING state regardless of the get result
if snmpget outputs anything to stderr.

--Andrew Mayhew <amayhew at verisign.com>

> -----Original Message-----
> From: Jackson Sie [mailto:jsie at quadrix.com]
> Sent: Thursday, August 01, 2002 9:18 AM
> To: 'Mayhew, Andrew'; nagiosplug-devel at lists.sourceforge.net
> Subject: RE: [Nagiosplug-devel] Patch for check_snmp.c
> 
> 
> Thanks for the patch Andrew!  Definitely useful for our 
> environment (you
> know debugging info and such...)  IMHO, have you thought 
> about providing
> for this functionality as a command line switch?
> 
> 
> Jackson Sie
> Senior Architect
> Quadrix Solutions, Inc.
> 
> 
> -----Original Message-----
> From: nagiosplug-devel-admin at lists.sourceforge.net
> [mailto:nagiosplug-devel-admin at lists.sourceforge.net] On Behalf Of
> Mayhew, Andrew
> Sent: Wednesday, July 31, 2002 5:54 PM
> To: 'nagiosplug-devel at lists.sourceforge.net'
> Subject: [Nagiosplug-devel] Patch for check_snmp.c
> 
> 
> Don't know if anyone else particularly cares, but for our 
> environment we
> like to get the full response from the SNMP get even if the status is
> OK. So this patch changes the output behaviour slightly to make it
> slightly more consistent in this regard.
> 
> Share and enjoy.
> --Andrew Mayhew <amayhew at verisign.com>
> 
> *** check_snmp.c        Wed Feb 27 22:42:59 2002
> --- check_snmp.c-new    Wed Jul 31 14:44:27 2002
> ***************
> *** 220,226 ****
>                         p2 = strpbrk (p2, "0123456789");
>                         response_value[i] = strtoul (p2, NULL, 10);
>                         iresult = check_num (i);
> !                       show = ssprintf (show, "%d", 
> response_value[i]);
>                 }
>   
>                 else if (eval_method[i] & CRIT_STRING) {
> --- 220,227 ----
>                         p2 = strpbrk (p2, "0123456789");
>                         response_value[i] = strtoul (p2, NULL, 10);
>                         iresult = check_num (i);
> !                       /* For consistency we want the full SNMP
> response
> every time. */
> !                       show = ssprintf (show, "%s", response);
>                 }
>   
>                 else if (eval_method[i] & CRIT_STRING) {
> ***************
> *** 291,297 ****
>         /* WARNING if output found on stderr */
>         if (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_stderr))
>                 result = max (result, STATE_WARNING);
> - 
>         /* close stderr */
>         (void) fclose (child_stderr);
>   
> --- 292,297 ----
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: Dice - The leading online job board
> for high-tech professionals. Search and apply for tech jobs today!
> http://seeker.dice.com/seeker.epl?rel_code=31
> _______________________________________________
> Nagiosplug-devel mailing list Nagiosplug-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
> 




More information about the Devel mailing list