O'Reilly logo

Essential SNMP by Kevin Schmidt, Douglas Mauro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Polling and Setting

We’ve put a lot of work into getting things set up so that we can use SNMP effectively. But now that we’ve installed a fancy node manager and configured agents on all our devices, what can we do? How can we interact with the devices that are out there?

The three basic SNMP operations are snmpget, snmpset, and snmpwalk. They are fairly self-explanatory: snmpget reads a value from a managed device, snmpset sets a value on a device, and snmpwalk reads a portion of the MIB tree from a device. For example, you can use snmpget to query a router and find out its administrative contact (i.e., the person to call if the router appears to be broken), snmpset to change this contact information, and snmpwalk to traverse a MIB to get an idea of which objects the router has implemented or to retrieve status information on all the router’s interfaces.

This chapter shows you how to use these operations in day-to-day network management. First, we will use Perl to demonstrate how you can set,get, and walkobjects in a script (the nice thing about using Perl is that you can easily extend the simple scripts in this chapter to fit your needs and environment). We will then use HP OpenView and Net-SNMP to perform the same operations, but from the command line. Finally, as an alternative to the command line, we will demonstrate OpenView’s graphical MIB Browser, which has a nice interface for getting, setting and walking MIB data.

Retrieving a Single MIB Value

Let’s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required