|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.collectd.SnmpNodeCollector
The SnmpNodeCollector class is responsible for performing the actual SNMP data collection for a node over a specified network interface. The SnmpNodeCollector implements the SnmpHandler class in order to receive notifications when an SNMP reply is received or error occurs. The SnmpNodeCollector is provided a list of MIB objects to collect and an interface over which to collect the data. Data collection can be via SNMPv1 GetNext requests or SNMPv2 GetBulk requests depending upon the parms used to construct the collector.
Field Summary | |
private SNMPCollectorEntry |
m_collectorEntry
Used to store the collected MIB data. |
private boolean |
m_error
Flag indicating the success or failure of the informational query. |
private int |
m_errorIndex
If the SNMP collection failed due to a problem with one or more varbinds (for example if a particular object oid is requested which is not implemented in the target's SNMP agent) then this value will be set equal to the *first* failing varbind in the request. |
private int |
m_errorStatus
Reason that the SNMP request failed. |
private static java.lang.String[] |
m_errorText
Array of SNMPv1 error strings. |
private int |
m_maxVarsPerPdu
Max number of variables permitted in a single outgoing SNMP PDU request.. |
private java.util.List |
m_objList
List of MibObject objects to be collected. |
private int |
m_oidListIndex
Initialized to zero. |
private java.lang.String |
m_primaryIf
Holds the IP Address of the primary SNMP iterface. |
private Signaler |
m_signal
Used to synchronize the class to ensure that the session has finished collecting data before the value of success or failure is set, and control is returned to the caller. |
private boolean |
m_timeout
Flag indicating if the SNMP collection failed due to the SNMP request timing out. |
private int |
m_version
Used for classifying the SNMP version of the session. |
Constructor Summary | |
private |
SnmpNodeCollector()
The default constructor is marked private and will always throw an exception. |
|
SnmpNodeCollector(SnmpSession session,
Signaler signaler,
java.util.List objList,
int maxVarsPerPdu)
The class constructor is used to initialize the collector and send out the initial SNMP packet requesting data. |
Method Summary | |
boolean |
failed()
Returns the success or failure code for collection of the data. |
SNMPCollectorEntry |
getEntry()
Returns the list of all entry maps that can be used to access all the information from the service polling. |
SnmpPduPacket |
getNextPdu(java.lang.String ifAddress)
This method constructs the next SnmpPduPacket (pdu) for sending to the remote node. |
void |
snmpInternalError(SnmpSession session,
int error,
SnmpSyntax pdu)
This method is part of the SnmpHandler interface and called when an internal error happens in a session. |
void |
snmpReceivedPdu(SnmpSession session,
int command,
SnmpPduPacket pdu)
This method is used to process received SNMP PDU packets from the remote agent. |
void |
snmpTimeoutError(SnmpSession session,
SnmpSyntax pdu)
This method is part of the SnmpHandler interface and is invoked when the SnmpSession does not receive a reply after exhausting the retransmission attempts. |
static SnmpObjectId |
stop_oid(java.lang.String oid)
This method will take an OID, and generate the succeeding OID. |
boolean |
timedout()
Returns true if SNMP collection failed due to timeout. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean m_error
private int m_errorStatus
private static java.lang.String[] m_errorText
private int m_errorIndex
private boolean m_timeout
private Signaler m_signal
private java.util.List m_objList
private int m_oidListIndex
private SNMPCollectorEntry m_collectorEntry
private int m_version
private java.lang.String m_primaryIf
private int m_maxVarsPerPdu
Constructor Detail |
private SnmpNodeCollector() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
- Always thrown from this method since it is not supported.public SnmpNodeCollector(SnmpSession session, Signaler signaler, java.util.List objList, int maxVarsPerPdu)
session
- The SNMP session with the remote agent.signaler
- The object signaled when data collection is done.objList
- The list of object id's to be collected.maxVarsPerPdu
- Max number of vars permitted in a single PDUMethod Detail |
public static SnmpObjectId stop_oid(java.lang.String oid)
oid
- Object identifier from which to generate the stop oid
public SnmpPduPacket getNextPdu(java.lang.String ifAddress)
ifAddress
- Interface address of the remote agent
SnmpNull
,
SnmpPduPacket
public void snmpReceivedPdu(SnmpSession session, int command, SnmpPduPacket pdu)
snmpReceivedPdu
in interface SnmpHandler
session
- The SNMP Session that received the PDUcommand
- The command contained in the received pdupdu
- The actual received PDU.public void snmpInternalError(SnmpSession session, int error, SnmpSyntax pdu)
snmpInternalError
in interface SnmpHandler
session
- The session that had an unexpected errorerror
- The error conditionpdu
- The PDU being sent when the error occuredsnmpTimeoutError(org.opennms.protocols.snmp.SnmpSession, org.opennms.protocols.snmp.SnmpSyntax)
,
SnmpHandler
public void snmpTimeoutError(SnmpSession session, SnmpSyntax pdu)
snmpTimeoutError
in interface SnmpHandler
session
- The session invoking the error handlerpdu
- The PDU that the remote failed to respond to.SnmpHandler
public boolean failed()
public boolean timedout()
public SNMPCollectorEntry getEntry()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |