Skip to Main Content
Essential SNMP, 2nd Edition
book

Essential SNMP, 2nd Edition

by Douglas Mauro, Kevin Schmidt
September 2005
Beginner content levelBeginner
462 pages
12h 56m
English
O'Reilly Media, Inc.
Content preview from Essential SNMP, 2nd Edition

Setting a MIB Value

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, and 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 ACCESS of 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 your vendor.

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 .1.3.6.1.2.1.1.4.0
system.sysContact.0 : DISPLAY STRING- (ascii):  ORA IT Group

The -c public switch passes the community string public to the snmpget command.

Tip

Keep in mind that your devices shouldn't use the same (default) community strings that are used in this book. In addition, using the same string for the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Essential SNMP

Essential SNMP

Douglas Mauro, Kevin Schmidt
UNIX and Linux System Administration Handbook, 5th Edition

UNIX and Linux System Administration Handbook, 5th Edition

Trent R. Hein, Evi Nemeth, Garth Snyder, Ben Whaley, Dan Mackin

Publisher Resources

ISBN: 0596008406Supplemental ContentErrata Page