[Nagiosplug-devel] Regression in check_snmp

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Jul 31 09:44:53 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 31/07/09 03:19 AM, Thomas Guyot-Sionnest wrote:
> On 31/07/09 02:59 AM, Ton Voon wrote:
>> Good catch. I'm on holiday for a week so I can't help with it for a few
>> days. That is the only issue I'm aware of at the moment
> 
> Turns out the error I showed was my fault - typo in the hostname - but
> I'm still wondering how the single quotes turns out to be. Maybe they're
> being ignored...
> 
> The problem is actually with multi-line strings. I just committed a new
> test script using a custom SNMP agent and now I'm able to reproduce the
> problem (segfault).
> 
> The simplest fix is easy, just skip any additional lines (i.e. if
> response if NULL), though if the string contains a delimiter it will
> likely blow chunks again.
> 
> I'll try to figure out what the 1.4.13 version did regarding these
> strings and will reproduce the behavior as much as I can.
> 

Duh... The old code was totally ugly, but it accounted for these
strings. If the string begins with a " it keeps reading until it find
the matching closing quote.

It was still broken in that it printed a | on the last line... should
appear on the first line as the rest is nagios3 extended output. Trying
to join lines back into one would be silly as the data length on the
first line if very limited.

So I'm tempted to keep the code and fix the perfdata... I would probably
append all multi-line output at the end so nagios3 can get it, while
fixing the performance data (if you have more than one OID and have
thresholds on non-strings). If I do so I will duplicate the first line
though so we'll see the whole output in the additional output lines.

It's pretty late here now... I'll finish another day :)

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKcqD16dZ+Kt5BchYRAjb7AKCBjGyad16Qk8z2/rIfU/eM/fgfYQCgnKjY
RhZyp/PTBQObGaLoOSwk/kY=
=G0EW
-----END PGP SIGNATURE-----




More information about the Devel mailing list