With snmpget and snmpwalk, we have retrieved management information only from devices. The next logical step is to change the value of a MIB object via SNMP. This operation is known as snmpset, or set. In this section we’ll read the value of an object, use snmpset to change its value, then read the value again to prove that it’s been changed.
There’s obviously some danger here: what happens if you change
a variable that’s critical to the state of the system
you’re monitoring? In this chapter, we’ll deal only with
some simple objects, such as the administrative contact, that
won’t damage anything if they’re changed incorrectly.
Therefore, if you keep the OIDs correct, you shouldn’t worry
about hurting any of your devices. All the objects we set in this
chapter have an
read-write. It’s a good idea to get a feel
for which objects are writable by reading the MIB in which the object
is defined -- either one of the RFCs or a MIB file provided by
Let’s get started. Run the following OpenView command (or use one of the other programs we’ve discussed) to find out the sysContact for your chosen device:
/opt/OV/bin/snmpget -c public orarouter1 .126.96.36.199.188.8.131.52.0system.sysContact.0 : DISPLAY STRING- (ascii): ORA IT Group
public switch passes the
community string public to the
Keep in mind that your devices shouldn’t use the same (default) community strings that are used within this book. In addition, using the same string ...