public final class IfTable extends SnmpTable<IfTableEntry>
The IfTable uses a SnmpSession to collect the entries in the remote agent's interface table. It implements the SnmpHandler to receive notifications and handle errors associated with the data collection. Data is collected using a series of GETNEXT PDU request to walk multiple parts of the interface table at once. The number of SNMP packets should not exceed the number of interface + 1, assuming no lost packets or error conditions occur.
Addition by Jon Whetzel
IfTable has an extra class variable for the SNMP version setting. If this is set for SNMPv2, then a GETBULK command will be used for retrieving the necessary data. Otherwise, the method will resort to its previous implementation with GETNEXT commands.
Constructor and Description |
---|
IfTable(InetAddress address)
Constructs an IfTable object that is used to collect the interface
elements from the remote agent.
|
IfTable(InetAddress address,
Set<SnmpInstId> ifIndices)
Constructor for IfTable.
|
Modifier and Type | Method and Description |
---|---|
protected IfTableEntry |
createTableEntry(SnmpObjId base,
SnmpInstId inst,
Object val)
createTableEntry
|
Integer |
getAdminStatus(int ifIndex)
getAdminStatus
|
String |
getIfDescr(int ifIndex)
getIfDescr
|
Set<Integer> |
getIfIndices()
getIfIndices
|
Long |
getIfSpeed(int ifIndex)
getIfSpeed
|
Integer |
getIfType(int ifIndex)
getIfType
|
Integer |
getOperStatus(int ifIndex)
getOperStatus
|
String |
getPhysAddr(int ifIndex)
getPhysAddr
|
void |
updateSnmpInterfaceData(OnmsNode node)
updateSnmpInterfaceData
|
void |
updateSnmpInterfaceData(OnmsNode node,
Integer ifIndex)
updateSnmpInterfaceData
|
getEntries, getEntry, getEntry, getInstances, reportFatalErr, reportGenErr, reportNonFatalErr, reportNoSuchNameErr, storeResult
buildNextPdu, getWalkRequests, handleWalkResponses, isFinished, setFailed, setMaxRepetitions, setMaxRetries, setTimedOut
failed, getCollectionTracker, getParent, reportTooBigErr, setFinished, setParent, timedOut
public IfTable(InetAddress address)
Constructs an IfTable object that is used to collect the interface elements from the remote agent. Once all the interfaces are collected, or there is an error in the collection the signaler object is notified to inform other threads.
address
- TODOIfTableEntry
public IfTable(InetAddress address, Set<SnmpInstId> ifIndices)
Constructor for IfTable.
address
- a InetAddress
object.ifIndices
- a Set
object.protected IfTableEntry createTableEntry(SnmpObjId base, SnmpInstId inst, Object val)
createTableEntry
createTableEntry
in class SnmpTable<IfTableEntry>
base
- a SnmpObjId
object.inst
- a SnmpInstId
object.val
- a Object
object.public Integer getOperStatus(int ifIndex)
getOperStatus
ifIndex
- a int.Integer
object.public Integer getAdminStatus(int ifIndex)
getAdminStatus
ifIndex
- a int.Integer
object.public Integer getIfType(int ifIndex)
getIfType
ifIndex
- a int.Integer
object.public String getIfDescr(int ifIndex)
getIfDescr
ifIndex
- a int.String
object.public Long getIfSpeed(int ifIndex)
getIfSpeed
ifIndex
- a int.Long
object.public String getPhysAddr(int ifIndex)
getPhysAddr
ifIndex
- a int.String
object.public void updateSnmpInterfaceData(OnmsNode node)
updateSnmpInterfaceData
node
- a OnmsNode
object.public void updateSnmpInterfaceData(OnmsNode node, Integer ifIndex)
updateSnmpInterfaceData
Copyright © 2021. All rights reserved.