Contents.Basic ExampleThe syntax of the snmpset command is similar to that of the snmpgetcommand, and most of the applies here too.The main difference is in specifying the information to work with.Instead of a single OID, the snmpset command requires theOID to update, the data type of this object, and the new value to apply:snmpset -v 1 -c demopublic test.net-snmp.org ucdDemoPublicString.0 s 'hi there!' The effect of this command can usually be seen by retrieving the value of an object,both before and after the SET request:$ snmpget -v 1 -c demopublic test.net-snmp.org ucdDemoPublicString.0UCD-DEMO-MIB::ucdDemoPublicString.0 = 'hi there!' $ snmpset -v 1 -c demopublic test.net-snmp.org ucdDemoPublicString.0 s 'Hello, world!' UCD-DEMO-MIB::ucdDemoPublicString.0 = 'Hello, world!'
$ snmpget -v 1 -c demopublic test.net-snmp.org ucdDemoPublicString.0UCD-DEMO-MIB::ucdDemoPublicString.0 = 'Hello, world!' Note that the values returned following the SET request will always be thesame as those provided.
![Snmpget Snmpget](http://i.imgur.com/xRwCPoT.jpg)
Net-SNMP Tutorial - snmpgetnext. The snmpgetnext command, which is similar in usage to the snmpget command, is used to retrieve the next oid in the mib tree of data. Instead of returing the data you requested, it returns the next OID in the tree and its value.