28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.2 Setting Router Information for the MIB-II System<br />

Group<br />

Problem<br />

You need to define specific information about the router, such as its name and location,<br />

to pass to the SNMP manager.<br />

Solution<br />

Set description, location, and contact information about the router:<br />

[edit snmp]<br />

aviva@router1# set description "JUNOS cookbook M20, aka router1"<br />

aviva@router1# set location "JUNOS cookbook kitchen"<br />

aviva@router1# set contact "aviva at extension 12345"<br />

<strong>Discussion</strong><br />

These commands provide general information, which is placed into objects in the<br />

MIB-II system group, about the router to the SNMP manager. The description string<br />

identifies the router and is placed into the sysDescription object. The location<br />

describes the router’s physical location and is placed into the sysLocation object.<br />

The contact identifies how to contact the router’s administrator and goes into the<br />

sysContact object. The name of the router you configured when you installed the<br />

router (the name in the set system host-name command) is placed into the sysName<br />

object. You can set a different router name to be used just for SNMP:<br />

[edit snmp]<br />

aviva@router1# set name junos-cookbook-router<br />

You can use a utility like snmpwalk from a Unix workstation to retrieve the agent’s<br />

information. (snmpwalk uses SNMP GetNext requests to query a network entity for a<br />

tree of information.) The following command uses the hostname of the agent<br />

(router1), but you can also use the IP address:<br />

aviva-server> snmpwalk -c public router1 system.sysDescr<br />

system.sysDescr.0 = JUNOS cookbook M20, aka router1<br />

aviva-server> snmpwalk -c public router1 system.sysContact<br />

system.sysContact.0 = aviva at extension 12345<br />

You can also get this information on the router itself. The following command shows<br />

all the settings in the system MIB:<br />

aviva@router1> show snmp mib walk system<br />

sysDescr.0 = JUNOS cookbook M20, aka router1<br />

sysObjectID.0 = jnxProductNameM20<br />

sysUpTime.0 = 2888368<br />

sysContact.0 = aviva at extension 12345<br />

sysName.0 = junos-cookbook-router<br />

Setting Router Information for the MIB-II System Group | 135<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!