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.

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

The SNMP standard Host Resources MIB, specified in RFC 2790, contains objects<br />

that allow you to retrieve the versions of the software running on the router. The<br />

absolute path to the OID for installed software is .1.3.6.1.2.1.25.6.3. From the CLI,<br />

you get this same information with the show version command (see Recipe 1.25):<br />

aviva@router1> show version<br />

Hostname: router1<br />

Model: m20<br />

JUNOS Base OS boot [7.4-20051024.0]<br />

JUNOS Base OS Software Suite [7.4-20051024.0]<br />

JUNOS Kernel Software Suite [7.4R1.7]<br />

JUNOS Packet Forwarding Engine Support (M20/M40) [7.4R1.7]<br />

JUNOS Routing Software Suite [7.4R1.7]<br />

JUNOS Online Documentation [7.4R1.7]<br />

JUNOS Crypto Software Suite [7.4R1.7]<br />

In the SNMP output, the software version is shown as 7.42R1.7.0, which includes<br />

the instance (.0) of the software package.<br />

See Also<br />

Recipe 1.25<br />

4.8 Extracting Hardware Inventory Information<br />

with SNMP<br />

Problem<br />

You want to use SNMP to find out router hardware information and which fieldreplaceable<br />

units (FRUs) are present in the router.<br />

Solution<br />

If you are logged in to the router, you can get information using the show snmp mib<br />

commands. To get information about a single router component:<br />

aviva@router1> show snmp mib get sysObjectID.0<br />

sysObjectID.0 = jnxProductNameJ230M20<br />

To get information about the next router component in the MIB:<br />

aviva@router1> show snmp mib get jnxBoxClass.0<br />

jnxBoxClass.0 = jnxProductLineM20.0<br />

aviva@router1> show snmp mib get-next jnxBoxClass.0<br />

jnxBoxDescr.0 = Juniper m20 Internet Backbone Router<br />

For information about a number of router components, list each one separately:<br />

142 | Chapter 4: SNMP<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!