Network Management
Week 8, Mar 21
LT-412, Mon 4:15-6:45 pm
Java
We will use the Drexel University Java SNMP package.
This is a mini-version of the snmpget command; it retrieves a single OID. It assumes localhost.
Review the code:
- Create the SNMPv1CommunicationInterface object
- Create the OID for which we are looking
- getMIBEntry (this performs the actual request)
- extract the value:
- newVars is the VarBindList returned
- pair is the first component of newVars, an (OID,value) pair
- snmpValue is the second component of pair
- downcast to correct actual type
Note that although the documentation states that an
OID is to convert to an int[], this in fact does not work; it must be long[].
Compiling and running:
CLASSPATH=".:snmp.jar:$CLASSPATH"
export CLASSPATH
javac snmpget.java
java snmpget arg
Demo on system group 1.3.6.1.2.1.1.x.0, 1.3.6.1.2.1.2.2.1.6.2
snmpgetnext.java
1.3.6.1.2.1.4.20 (should be an IP address)
Demo of table
retrieval. Here we use retrieveMIBTable, rather than getMIBEntry. The
only difference is that we now retrieve a rather long SNMPVarBindList
rather than one of length 1. Note makeArrayList(), not actually used.
What would you have to do to retrieve one row of this table?
What would you have to do to retrieve row i, column j?
What would you have to do to get a column? Assuming you did not know the dimensions of the table?
What would you have to do to get all the OID index values?
tableget2.java
Here I convert from SNMPVarBindList to ArrayList<SNMPSequence>.
Also, printing is deferred until the end, and there is a printValue
method that does some casting.
Some NMS products:
OpenNMS:
GroundWork
Nagios
lots of commercial ones
Why open source? To get people to write app-specific modules!
Centralized v Distributed configurations
Two basic strategies:
- one NMS, queries all agents
- intermediate agents querying subagents, collating results,
reporting to master NMS
The latter can be leveraged into multi-layer
management structures
Inter-AS routing: BGP
complex administrative choices
transit or no transit?
Accept routes from neighbors (input selection)
route selection?
advertise chosen route to where? (output selection)
Multi_exit_discriminator (MED)