Extracting Software Inventory Information with SNMP


You want to use SNMP to retrieve software version information from the router.


From an NMS system, use the snmpwalk command:

	aviva-server1% snmpwalk public .
	host.hrSWInstalled.hrSWInstalledTable.hrSWInstalledEntry.hrSWInstalledName.2 = "JUNOS
	Base OS Software Suite [7.4R1.7.0]"
	host.hrSWInstalled.hrSWInstalledTable.hrSWInstalledEntry.hrSWInstalledName.3 = "JUNOS
	Kernel Software Suite [7.4R1.7.0]"
	host.hrSWInstalled.hrSWInstalledTable.hrSWInstalledEntry.hrSWInstalledName.4 = "JUNOS
	Packet Forwarding Engine Support (M20/M40) [7.4R1.7.0]"
	host.hrSWInstalled.hrSWInstalledTable.hrSWInstalledEntry.hrSWInstalledName.5 = "JUNOS
	Routing Software Suite [7.4R1.7.0]"
	host.hrSWInstalled.hrSWInstalledTable.hrSWInstalledEntry.hrSWInstalledName.6 = "JUNOS
	Online Documentation [7.4R1.7.0]"
	host.hrSWInstalled.hrSWInstalledTable.hrSWInstalledEntry.hrSWInstalledName.7 = "JUNOS
	Crypto Software Suite [7.4R1.7.0]"
	host.hrSWInstalled.hrSWInstalledTable.hrSWInstalledEntry.hrSWInstalledName.9 = "JUNOS
	Support Tools Package [7.4R1.7.0]"

From the router, use the following equivalent command:

	aviva@router1> show snmp mib walk .
	hrSWInstalledName.2 = JUNOS Base OS Software Suite [7.4R1.7.0]
	hrSWInstalledName.3 = JUNOS Kernel Software Suite [7.4R1.7.0]
	hrSWInstalledName.4 = JUNOS Packet Forwarding Engine Support (M20/M40) [7.4R1.7.0]
	hrSWInstalledName.5 = JUNOS Routing Software Suite [7.4R1.7.0]
	hrSWInstalledName.6 = JUNOS Online Documentation [7.4R1.7.0]
	hrSWInstalledName.7 = JUNOS Crypto Software Suite [7.4R1.7.0]
	hrSWInstalledName.9 = JUNOS Support Tools Package [7.4R1.7.0]



The SNMP standard Host Resources MIB, specified in RFC 2790, contains objects that allow you to retrieve the versions of the software running on the router. The absolute path to the OID for installed software is . From the CLI, you get this same information with the show version command (see Recipe 1.25):

	aviva@router1> show version
	Hostname: router1
	Model: m20
	JUNOS Base OS boot [7.4-20051024.0]
	JUNOS Base OS Software Suite [7.4-20051024.0]
	JUNOS Kernel Software Suite [7.4R1.7]
	JUNOS Packet Forwarding Engine Support (M20/M40) [7.4R1.7]
	JUNOS Routing Software Suite [7.4R1.7]
	JUNOS Online Documentation [7.4R1.7]
	JUNOS Crypto Software Suite [7.4R1.7]

In the SNMP output, the software version is shown as 7.42R1.7.0, which includes the instance (.0) of the software package.

See Also

Recipe 1.25

Router Configuration and File Management

Basic Router Security and Access Control





Router Interfaces

IP Routing

Routing Policy and Firewall Filters







IP Multicast

JUNOS Cookbook
Junos Cookbook (Cookbooks (OReilly))
ISBN: 0596100140
EAN: 2147483647
Year: 2007
Pages: 290
Authors: Aviva Garrett

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net