[Nagiosplug-devel] error in check_snmp (function spopen)

Thomas Guyot-Sionnest dermoth at aei.ca
Thu May 29 00:59:46 CEST 2008


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

On 28/05/08 03:24 PM, Uwe Knop wrote:
> Hallo,
> 
> 
> i use externel commands with  'extend' function  with net-snmp.
> 
> Here is an sample service check:
> 
> check_snmp!public!'NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"testname\"'
> 
> Access with numeric OID's  as far as i know,  not possible.

Have you tried snmptranslate -On <OID> ? It should give you the numeric OID.

Text strings in OIDs as encoded in ASCII using decimal notation, the
first OID being the length of the string. If you want an example in Perl
see my check_bigip_* plugins at
http://www.nagiosexchange.org/cgi-bin/page.cgi?g=2447.html;d=1

Relevant code excerpts:

check_bigip_pool:
  my $oidPoolName = $PoolName;
  $oidPoolName =~ s/(.)/sprintf('.%u', ord($1))/eg;
  $oidPoolName = length($PoolName) . $oidPoolName;
  # Then append $oidPoolName to the base OID

check_bigip_vs:
  $oid = $bip{$software}{'OID'};
  my $vslength = length($virtualServer);
  $virtualServer =~ s/(.)/sprintf('.%u', ord($1))/eg;
  $oid .= $vslength . $virtualServer;

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

iD8DBQFIPePi6dZ+Kt5BchYRAqxfAKCc8iHSlJha5599Y47eIEfx6PHUngCdEEW7
97/GKyvGk+LeW97h/7Ynn90=
=DVij
-----END PGP SIGNATURE-----




More information about the Devel mailing list