|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.threshd.SnmpThresholder
The SnmpThresholder class ...
Field Summary | |
(package private) static java.lang.String |
ALL_IF_THRESHOLD_MAP_KEY
We must maintain a map of interface level ThresholdEntity objects on a per interface basis in order to maintain separate exceeded counts and the like for each of a node's interfaces. |
(package private) static java.lang.String |
BASE_IF_THRESHOLD_MAP_KEY
Interface attribute key used to store a map of interface level ThresholdEntity objects keyed by datasource name. |
private static int |
DEFAULT_INTERVAL
Default thresholding interval (in milliseconds). |
private java.lang.String |
m_host
Local host name |
private Interface |
m_rrdInterface
Instance of org.opennms.netmgt.rrd.Interface singleton class which provides access to RRD functions via JNI. |
(package private) static java.lang.String |
NODE_ID_KEY
Interface attribute key used to store the interface's node id |
(package private) static java.lang.String |
NODE_THRESHOLD_MAP_KEY
Interface attribute key used to store a map of node level ThresholdEntity objects keyed by datasource name. |
(package private) static java.lang.String |
RRD_REPOSITORY_KEY
Interface attribute key used to store the interface's node id |
private static java.lang.String |
SERVICE_NAME
Name of monitored service. |
private static java.lang.String |
SQL_GET_NODEID
SQL statement to retrieve interface's 'ipinterface' table information. |
Fields inherited from interface org.opennms.netmgt.threshd.ServiceThresholder |
statusType, THRESHOLDING_FAILED, THRESHOLDING_SUCCEEDED, THRESHOLDING_UNKNOWN |
Constructor Summary | |
(package private) |
SnmpThresholder()
|
Method Summary | |
int |
check(NetworkInterface iface,
EventProxy eproxy,
java.util.Map parameters)
Perform threshold checking. |
private void |
checkIfDir(java.io.File directory,
java.lang.Integer nodeId,
java.net.InetAddress primary,
int interval,
java.util.Date date,
java.util.Map baseIfThresholdMap,
java.util.Map allIfThresholdMap,
Events events)
Performs threshold checking on an SNMP RRD interface directory. |
private void |
checkNodeDir(java.io.File directory,
java.lang.Integer nodeId,
java.net.InetAddress primary,
int interval,
java.util.Date date,
java.util.Map thresholdMap,
Events events)
Performs threshold checking on an SNMP RRD node directory. |
private Event |
createEvent(java.lang.Integer nodeId,
java.net.InetAddress primary,
java.util.Map ifDataMap,
double dsValue,
Threshold threshold,
java.lang.String uei,
java.util.Date date)
Creates a new threshold event from the specified parms. |
private java.lang.Double |
fetch(java.lang.String rrdFile,
int interval)
This method uses the RRD JNI interface to issue an RRD fetch command to retrieve the last value of the datasource stored in the specified RRD file. |
void |
initialize(java.util.Map parameters)
Initialize the service thresholder. |
void |
initialize(NetworkInterface iface,
java.util.Map parameters)
Responsible for performing all necessary initialization for the specified interface in preparation for thresholding. |
void |
release()
Responsible for freeing up any resources held by the thresholder. |
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"). |
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 SQL_GET_NODEID
private static final java.lang.String SERVICE_NAME
private static final int DEFAULT_INTERVAL
static final java.lang.String NODE_ID_KEY
static final java.lang.String RRD_REPOSITORY_KEY
static final java.lang.String NODE_THRESHOLD_MAP_KEY
static final java.lang.String BASE_IF_THRESHOLD_MAP_KEY
static final java.lang.String ALL_IF_THRESHOLD_MAP_KEY
private Interface m_rrdInterface
private java.lang.String m_host
Constructor Detail |
SnmpThresholder()
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 thresholder.
initialize
in interface ServiceThresholder
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 ServiceThresholder
public void initialize(NetworkInterface iface, java.util.Map parameters)
initialize
in interface ServiceThresholder
iface
- Network interface to be prepped for thresholding.parameters
- Key/value pairs associated with the package
to which the interface belongs..public void release(NetworkInterface iface)
release
in interface ServiceThresholder
iface
- Network interface to be released.public int check(NetworkInterface iface, EventProxy eproxy, java.util.Map parameters)
check
in interface ServiceThresholder
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 void checkNodeDir(java.io.File directory, java.lang.Integer nodeId, java.net.InetAddress primary, int interval, java.util.Date date, java.util.Map thresholdMap, Events events) throws java.lang.IllegalArgumentException
directory
- RRD repository directorynodeId
- Node identifierprimary
- Primary SNMP interface addressinterval
- Configured thresholding intervaldate
- Source for timestamp to be used for all
generated eventsthresholdMap
- Map of node level ThresholdEntity objects
keyed by datasource name.events
- Castor events object containing any
events to be generated as a result
of threshold checking.
java.lang.IllegalArgumentException
- if path parameter is not a directory.private void checkIfDir(java.io.File directory, java.lang.Integer nodeId, java.net.InetAddress primary, int interval, java.util.Date date, java.util.Map baseIfThresholdMap, java.util.Map allIfThresholdMap, Events events) throws java.lang.IllegalArgumentException
directory
- RRD repository directorynodeId
- Node identifierprimary
- Primary SNMP interface addressinterval
- Configured thresholding intervaldate
- Source for timestamp to be used for all
generated eventsbaseIfThresholdMap
- Map of configured interface level ThresholdEntity
objects keyed by datasource name.allIfThresholdMap
- Map of threshold maps indexed by ifLabelevents
- Castor events object containing any
events to be generated as a result
of threshold checking.
java.lang.IllegalArgumentException
- if path parameter is not a directory.private java.lang.Double fetch(java.lang.String rrdFile, int interval) throws java.lang.NumberFormatException
rrdFile
- RRD file from which to fetch the data.interval
- Thresholding interval (should equal RRD step size)
java.lang.NumberFormatException
- if the retrieved value fails to
convert to a doubleprivate Event createEvent(java.lang.Integer nodeId, java.net.InetAddress primary, java.util.Map ifDataMap, double dsValue, Threshold threshold, java.lang.String uei, java.util.Date date)
nodeId
- node identifier of the affected nodeprimary
- IP address of the affected primary SNMP interfaceifDataMap
- Map of this node's interface informationdsValue
- Data source value which triggered the threshold eventthreshold
- Configured thresholduei
- Event identifierdate
- source of event's timestamp
|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |