Recording Important Router Information for SNMP Access

Problem

You want to record important information, such as physical locations, contact names, and serial numbers for later SNMP access.

Solution

To record important physical information regarding the router, use the following commands:

Router#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#snmp-server contact Ian Brown 416-555-2943
Router(config)#snmp-server location 999 Queen St. W., Toronto, Ont.
Router(config)#snmp-server chassis-id JAX123456789
Router(config)#end
Router#

Discussion

It is an extremely good network management practice to add useful information such as contact names, router locations, and serial numbers directly into the router configuration. This information can be extracted later using snmpget requests, either directly or invoked from scripts that make output easier to understand. This is true not only for Cisco routers, of course. Any time you have to manage remote equipment, you should configure important information like serial numbers and locations so that you can read it with SNMP. When a field technician swaps or moves a piece of equipment, they can update this information. So this way you can easily verify the information you store in your central equipment inventory database.

When you save the contact name, router location, and serial number in the router configuration like this, it is also easy to extract from the command line and configuration files as well: ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.