Re: check_snmp Changed Behavior
Jochen Bern <Jochen.Bern-RMkW/[email protected]>
| Newsgroups | gmane.network.nagios.plugins.devel |
|---|---|
| Organization | LINworks GmbH |
| Message-ID | <[email protected]> |
On 06/21/2012 11:22 AM, Ferenc Wagner wrote: > Jochen Bern <Jochen.Bern-RMkW/[email protected]> 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 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________________ Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5upmplPMkL2fr@public.gmane.orget Unsubscribe at 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