Re: need help setting a basic extented snmp agent with perl
Manfred Wassmann <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 28 Jan 2008, Jordi Moles Blanco wrote:
> I would like to do some thing as easy as this:
>
>
> in my snmpd.conf
>
>
> pass .1.2.3.4.5.6.7.8.9.10 /root/myperl.pl
>
>
>
> then in this myperl.pl
>
> something as simple as.....
>
>
> echo "77";
>
[...]
>
> The snmpget command always says it didn't find the OID i'm asking for.
Quoting from the snmpd man page:
pass [-p priority] MIBOID PROG
will pass control of the subtree rooted at MIBOID to the speci-
fied PROG command. GET and GETNEXT requests for OIDs within
this tree will trigger this command, called as:
PROG -g OID
PROG -n OID
respectively, where OID is the requested OID. The PROG command
should return the response varbind as three separate lines
printed to stdout - the first line should be the OID of the
returned value, the second should be its TYPE (one of the text
strings integer, gauge, counter, timeticks, ipaddress, objectid,
or string ), and the third should be the value itself.
If the command cannot return an appropriate varbind - e.g the
specified OID did not correspond to a valid instance for a GET
request, or there were no following instances for a GETNEXT -
then it should exit without producing any output. This will
result in an SNMP noSuchName error, or a noSuchInstance excep-
tion.
That is, as long as your myperl.pl does not return three lines of
output with OID, type and value, you will always get this error from
snmpget.
HTH
-------------------------------------------------------------------------
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/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users