= Examples scripts =
 
= Examples scripts =
 +
 +
== Simplistic example ==
 +
Here is a simple example using echo:
 +
 +
* snmpd.conf
 +
rocommunity testing
 +
extend test /bin/echo hello
 +
 +
* retrieving value
 +
 +
$ snmpwalk -v2c -c testing 127.0.0.1 nsExtendOutput1
 +
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."test" = STRING: hello
 +
NET-SNMP-EXTEND-MIB::nsExtendOutputFull."test" = STRING: hello
 +
NET-SNMP-EXTEND-MIB::nsExtendOutNumLines."test" = INTEGER: 1
 +
NET-SNMP-EXTEND-MIB::nsExtendResult."test" = INTEGER: 0
 +
 +
* finding the OID
 +
 +
$ snmptranslate -On NET-SNMP-EXTEND-MIB::nsExtendOutput1Line.\"test\"
 +
.1.3.6.1.4.1.8072.1.3.2.3.1.1.4.116.101.115.116
 +
 
== Use the source, Luke ==
 
== Use the source, Luke ==
 
The GIT tree has 3 example scripts.
 
The GIT tree has 3 example scripts.
   Exception encountered, of type "Error"