[aklug] Re: Exit status of scripts

From: James Zuelow <James_Zuelow@ci.juneau.ak.us>
Date: Fri Jun 05 2009 - 14:06:44 AKDT

Yes.

But if I just print a value to sdtout or stderr, I don't get that same valu=
e back with snmpwalk (or OpenNMS, which is where I'm really going with this=
).

For example:

- /bin/bash
- i=3D99
- echo $i

Will print out 99 to the shell, but snmpd sees a null value.

James Zuelow....................CBJ MIS (907)586-0236
Network Specialist...Registered Linux User No. 186591=20

> -----Original Message-----
> From: aklug-bounce@aklug.org [mailto:aklug-bounce@aklug.org]=20
> On Behalf Of Royce Williams
> Sent: Friday, 05 June, 2009 13:54
> To: aklug@aklug.org
> Subject: [aklug] Re: Exit status of scripts
>=20
> James Zuelow wrote, on 6/5/2009 1:46 PM:
> > I can extend the net-snmp daemon by having it run scripts.
> >=20
> > Net-snmpd can use the exit value of the script, so for example:
> >=20
> > - /bin/bash
> > - i=3D3D120
> > - exit $i
> >=20
> > Would return "120" to snmpd when it ran the script. (When=20
> it was queried fo=3D
> > r that OID.)
> >=20
> > The problem is that exit values are limited to 255, and I=20
> can see where you=3D
> > could need values that exceed 255 returned to snmpd. =20
> There's got to be a =3D
> > way to have a script return larger values to snmpd, but I'm=20
> not finding it =3D
> > today.
>=20
> Are you using NET-SNMP-EXTEND-MIB::nsExtendCommand? If so, the output
> itself is what gets stuff into the OID, IIRC.
>=20
> Royce
>=20
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.
>=20
> =
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri Jun 5 14:06:56 2009

This archive was generated by hypermail 2.1.8 : Fri Jun 05 2009 - 14:06:56 AKDT