[Nagiosplug-devel] Antw: Re: error in check_snmp (function spopen)
Uwe Knop
Uwe.Knop at lds.brandenburg.de
Thu May 29 08:49:20 CEST 2008
Hi Thomas,
thank you this works.
snmptranslate -On NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"testname\"
I should the next once RTFM.
bye
Uwe
>>>
Von: Thomas Guyot-Sionnest <dermoth at aei.ca>
An:Nagios Plugin Development Mailing List <nagiosplug-devel at lists.sourceforge.net>
Datum:29.05.08 00:57
Betreff:Re: [Nagiosplug-devel] error in check_snmp (function spopen)
-----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-----
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel at lists.sourceforge.net
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nagios-plugins.org/archive/devel/attachments/20080529/41941a8b/attachment.html>
More information about the Devel
mailing list