|
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.SnmpCollector
The SnmpCollector class ...
Field Summary | |
private static int |
DEFAULT_MAX_VARS_PER_PDU
This defines the default maximum number of variables the collector is permitted to pack into a single outgoing PDU. |
private static java.lang.String |
DEFAULT_OBJECT_IDENTIFIER
Default object to collect if "oid" property not available. |
(package private) static java.lang.String |
IF_MAP_KEY
Interface attribute key used to store the map of IfInfo objects which hold data about each interface on a particular node. |
(package private) static java.lang.String |
INTERFACE_COUNT_KEY
Interface attribute key used to store the number of interfaces configured on the remote host. |
private static java.lang.String |
INTERFACES_IFNUMBER
Object identifier used to retrieve interface count. |
private java.lang.String |
m_host
Local host name |
private int |
m_maxVarsPerPdu
Max number of variables permitted in a single outgoing SNMP PDU request.. |
private java.lang.String |
m_rrdPath
Path to SNMP RRD file repository. |
(package private) static java.lang.String |
MAX_VARS_PER_PDU_STORAGE_KEY
Interface attribute key used to store configured value for the maximum number of variables permitted in a single outgoing SNMP PDU request. |
(package private) static java.lang.String |
NODE_INFO_KEY
Interface attribute key used to store a NodeInfo object which holds data about the node being polled. |
private static java.lang.String |
SERVICE_NAME
Name of monitored service. |
(package private) static java.lang.String |
SNMP_PEER_KEY
Interface attribute key used to store the interface's JoeSNMP SnmpPeer object. |
private static java.lang.String |
SNMP_STORAGE_ALL
|
(package private) static java.lang.String |
SNMP_STORAGE_KEY
Interface attribute key used to store the data collection scheme to be followed. |
private static java.lang.String |
SNMP_STORAGE_PRIMARY
Valid values for the 'snmpStorageFlag' attribute in datacollection-config xml file. |
private static java.lang.String |
SNMP_STORAGE_SELECT
|
private static java.lang.String |
SQL_CHECK_SNMPV2
SQL statement to check for SNMPv2 for a node |
private static java.lang.String |
SQL_GET_ISSNMPPRIMARY
SQL statement to retrieve interface's 'issnmpprimary' table information. |
private static java.lang.String |
SQL_GET_NODEID
SQL statement to retrieve interface's 'ipinterface' table information. |
private static java.lang.String |
SQL_GET_NODESYSOID
/** SQL statement to retrieve node's system object id. |
private static java.lang.String |
SQL_GET_SNMP_INFO
SQL statement to fetch the ifIndex, ifName, and ifDescr values for all interfaces associated with a node |
Fields inherited from interface org.opennms.netmgt.collectd.ServiceCollector |
COLLECTION_FAILED, COLLECTION_SUCCEEDED, COLLECTION_UNKNOWN, statusType |
Constructor Summary | |
(package private) |
SnmpCollector()
|
Method Summary | |
private java.util.List |
buildDataSourceList(java.lang.String collectionName,
java.util.List oidList)
This method is responsible for building a list of RRDDataSource objects from the provided list of MibObject objects. |
int |
collect(NetworkInterface iface,
EventProxy eproxy,
java.util.Map parameters)
Perform data collection. |
private void |
generateForceRescanEvent(java.lang.String ifAddress,
EventProxy eventProxy)
This method is responsible for building a Capsd forceRescan event object and sending it out over the EventProxy. |
private int |
getInterfaceCount(SnmpPeer peer)
Retrieves ifNumber object from the MIB-II interfaces table which is the number of interfaces on the remote node and then returns this value. |
java.lang.String |
getRRDValue(DataSource ds,
SNMPCollectorEntry collectorEntry)
|
void |
initialize(java.util.Map parameters)
Initialize the service collector. |
void |
initialize(NetworkInterface iface,
java.util.Map parameters)
Responsible for performing all necessary initialization for the specified interface in preparation for data collection. |
void |
release()
Responsible for freeing up any resources held by the collector. |
void |
release(NetworkInterface iface)
Responsible for releasing any resources associated with the specified interface. |
java.lang.String |
serviceName()
Returns the name of the service that the plug-in collects ("SNMP"). |
private boolean |
testSnmpV2Support(java.net.InetAddress addr)
Responsible for testing the specified interface for SNMPv2 support. |
private boolean |
updateRRDs(java.lang.String collectionName,
NetworkInterface iface,
SnmpNodeCollector nodeCollector,
SnmpIfCollector ifCollector)
This method is responsible for building an RRDTool style 'update' command which is issued via the RRD JNI interface in order to push the latest SNMP-collected values into the interface's RRD database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String SERVICE_NAME
private static final java.lang.String SQL_GET_NODEID
private static final java.lang.String SQL_GET_ISSNMPPRIMARY
private static final java.lang.String SQL_GET_NODESYSOID
private static final java.lang.String SQL_CHECK_SNMPV2
private static final java.lang.String SQL_GET_SNMP_INFO
private static final java.lang.String DEFAULT_OBJECT_IDENTIFIER
private static final java.lang.String INTERFACES_IFNUMBER
private static java.lang.String SNMP_STORAGE_PRIMARY
private static java.lang.String SNMP_STORAGE_ALL
private static java.lang.String SNMP_STORAGE_SELECT
private static int DEFAULT_MAX_VARS_PER_PDU
private int m_maxVarsPerPdu
private java.lang.String m_rrdPath
private java.lang.String m_host
static final java.lang.String SNMP_PEER_KEY
static final java.lang.String INTERFACE_COUNT_KEY
static java.lang.String IF_MAP_KEY
static java.lang.String NODE_INFO_KEY
static java.lang.String SNMP_STORAGE_KEY
static java.lang.String MAX_VARS_PER_PDU_STORAGE_KEY
Constructor Detail |
SnmpCollector()
Method Detail |
public java.lang.String serviceName()
Returns the name of the service that the plug-in collects ("SNMP").
public void initialize(java.util.Map parameters)
Initialize the service collector.
During initialization the SNMP collector: - Initializes various configuration factories. - Verifies access to the database - Verifies access to RRD file repository - Verifies access to JNI RRD shared library - Determines if SNMP to be stored for only the node'sprimary interface or for all interfaces.
initialize
in interface ServiceCollector
parameters
- Not currently used.
java.lang.RuntimeException
- Thrown if an unrecoverable error occurs that prevents the
plug-in from functioning.public void release()
release
in interface ServiceCollector
public void initialize(NetworkInterface iface, java.util.Map parameters)
initialize
in interface ServiceCollector
iface
- Network interface to be prepped for collection.parameters
- Key/value pairs associated with the package to which the
interface belongs..public void release(NetworkInterface iface)
release
in interface ServiceCollector
iface
- Network interface to be released.public int collect(NetworkInterface iface, EventProxy eproxy, java.util.Map parameters)
collect
in interface ServiceCollector
iface
- Network interface to be data collected.eproxy
- Eventy proxy for sending events.parameters
- Key/value pairs from the package to which the interface
belongs.private boolean updateRRDs(java.lang.String collectionName, NetworkInterface iface, SnmpNodeCollector nodeCollector, SnmpIfCollector ifCollector)
collectionName
- SNMP data Collection name from 'datacollection-config.xml'iface
- NetworkInterface object of the interface currently being
pollednodeCollector
- Node level MIB data collected via SNMP for the polled
interfaceifCollector
- Interface level MIB data collected via SNMP for the polled
interface
java.lang.RuntimeException
- Thrown if the data source list for the interface is null.public java.lang.String getRRDValue(DataSource ds, SNMPCollectorEntry collectorEntry) throws java.lang.IllegalArgumentException
ds
- collectorEntry
-
java.lang.Exception
java.lang.IllegalArgumentException
private java.util.List buildDataSourceList(java.lang.String collectionName, java.util.List oidList)
collectionName
- Collection nameoidList
- List of MibObject objects defining the oid's to be collected
via SNMP.
private void generateForceRescanEvent(java.lang.String ifAddress, EventProxy eventProxy)
ifAddress
- interface address to which this event pertainseventProxy
- proxy over which an event may be sent to eventdprivate boolean testSnmpV2Support(java.net.InetAddress addr)
addr
- Interface to test.
private int getInterfaceCount(SnmpPeer peer)
peer
- SnmpPeer object used to communicate with the remote SNMP
agent.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |