Comtrol eCos User Manual
Page 629

Chapter 47. SNMP for eCos
PASS-THROUGH CONTROL
pass MIBOID EXEC
Passes entire control of MIBOID to
the
EXEC
pro-
gram.
The
EXEC
program
is called in one of the
following three ways:
EXEC -g MIBOID
EXEC -n MIBOID
These call lines match to SNMP get and
get-
next requests.
It is expected that the EXEC
program will take the arguments passed to it
and
return the appropriate response through
it’s stdout.
The first line of stdout should be
the
mib
OID of the returning value.
The second line
should be the TYPE of value returned,
where
TYPE
is
one
of
the text strings: string,
integer,
unsigned,
objectid,
timeticks,
ipaddress,
counter,
or
gauge.
The third
line of stdout should be
the
VALUE
corre-
sponding with the returned TYPE.
For
instance, if a script was to return the
value integer value "42" when a request
for
.1.3.6.1.4.100
was
requested,
the
script
should return the following 3 lines:
.1.3.6.1.4.100
integer
42
To indicate that the
script
is
unable
to
comply with the request due to an end-of-mib
condition or an invalid request, simple exit
and
return
no
output to stdout at all.
A
snmp error will be
generated
corresponding
to the SNMP NO-SUCH-NAME response.
EXEC -s MIBOID TYPE VALUE
For SNMP set requests, the above call method
is used.
The TYPE passed to the
EXEC
pro-
gram
is
one
of the text strings: integer,
counter, gauge, timeticks, ipaddress, objid,
or
string,
indicating
the
type
of value
passed in the next argument.
Return nothing to stdout, and the
set
will
assumed to have been successful.
Otherwise,
return one of the following error strings to
signal an error: not-writable, or wrong-type
and the appropriate error response
will
be
generated instead.
525