[Nagiosplug-devel] check_snmp Changed Behavior

Jochen Bern Jochen.Bern at LINworks.de
Thu Jun 21 18:10:30 CEST 2012


On 06/21/2012 11:22 AM, Ferenc Wagner wrote:
> Jochen Bern <Jochen.Bern at LINworks.de> writes:
>> Quick question: I'm comparing versions 1.4.14 and 1.4.15 of check_snmp
>> and found two differences that I suspect not to be intentional.  Does
>> someone happen to know for sure?
> Not at all, but I usually avoid check_snmp, as it calls the snmpget
> Net-SNMP utility in a way that their behaviour depends on various
> configuration files.  You may also want to check this...

Thanks for the hint, but that's not the case here - I'm issuing both
commands from the same shell, have tracked down part of the differences
in the actual code, and to make sure, I just reran the commands with
"-vv" and found that they use the same snmpget command line and receive
the same output from it.

For example, this is the part in the 1.4.15 code that processes
Timeticks results:

>                 else if (strstr (response, "Timeticks: "))
>                         show = strstr (response, "Timeticks: ");

Note that it does *not* make 'show' skip over the type declaration, or
labels the result as numeric, unlike:

>                 else if (strstr (response, "INTEGER: ")) {
>                         show = strstr (response, "INTEGER: ") + 9;
>                         is_numeric++;
>                 }

so that when it comes to constructing the performance data string:

>                 /* Write perfdata with whatever can be parsed by strtod, if possible */
>                 ptr = NULL;
>                 strtod(show, &ptr);
>                 if (ptr > show) {

strtod() starts reading the 'T' and that's the end of it.

Kind regards,
								J. Bern
-- 
Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel




More information about the Devel mailing list