[aklug] Re: Exit status of scripts

From: Royce Williams <royce@alaska.net>
Date: Fri Jun 05 2009 - 13:53:50 AKDT

James Zuelow wrote, on 6/5/2009 1:46 PM:
> I can extend the net-snmp daemon by having it run scripts.
>
> Net-snmpd can use the exit value of the script, so for example:
>
> - /bin/bash
> - i=3D120
> - exit $i
>
> Would return "120" to snmpd when it ran the script. (When it was queried fo=
> r that OID.)
>
> The problem is that exit values are limited to 255, and I can see where you=
> could need values that exceed 255 returned to snmpd. There's got to be a =
> way to have a script return larger values to snmpd, but I'm not finding it =
> today.

Are you using NET-SNMP-EXTEND-MIB::nsExtendCommand? If so, the output
itself is what gets stuff into the OID, IIRC.

Royce

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri Jun 5 13:54:02 2009

This archive was generated by hypermail 2.1.8 : Fri Jun 05 2009 - 13:54:02 AKDT