OpenNMS API 1.2.3

org.opennms.netmgt.threshd
Class LatencyThresholder

java.lang.Object
  extended byorg.opennms.netmgt.threshd.LatencyThresholder
All Implemented Interfaces:
ServiceThresholder

final class LatencyThresholder
extends java.lang.Object
implements ServiceThresholder

The LatencyThresholder class ...

Author:
Mike Davidson , OpenNMS

Field Summary
private static int DEFAULT_INTERVAL
          Default thresholding interval (in milliseconds).
private  java.lang.String m_host
          Local host name
private  java.lang.String m_svcName
          Specific service that this thresholder is responsible for latency threshold checking.
(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 RRD_REPOSITORY_KEY
          Interface attribute key used to store the interface's node id
private static java.lang.String SQL_GET_NODEID
          SQL statement to retrieve interface's 'ipinterface' table information.
(package private) static java.lang.String THRESHOLD_MAP_KEY
          Interface attribute key used to store configured thresholds
 
Fields inherited from interface org.opennms.netmgt.threshd.ServiceThresholder
statusType, THRESHOLDING_FAILED, THRESHOLDING_SUCCEEDED, THRESHOLDING_UNKNOWN
 
Constructor Summary
(package private) LatencyThresholder()
           
 
Method Summary
 int check(NetworkInterface iface, EventProxy eproxy, java.util.Map parameters)
          Perform threshold checking.
private  void checkRrdDir(java.io.File directory, int nodeId, java.net.InetAddress ipAddr, int interval, java.util.Date date, java.util.Map thresholdMap, Events events)
          Performs threshold checking on an directory which contains one or more RRD files containing latency/response time information.
private  Event createEvent(int nodeId, java.net.InetAddress ipAddr, double dsValue, Threshold threshold, java.lang.String uei, java.util.Date date)
          Creates a new threshold event from the specified parms.
 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 threshold checks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQL_GET_NODEID

private static final java.lang.String SQL_GET_NODEID
SQL statement to retrieve interface's 'ipinterface' table information.

See Also:
Constant Field Values

DEFAULT_INTERVAL

private static final int DEFAULT_INTERVAL
Default thresholding interval (in milliseconds).

See Also:
Constant Field Values

RRD_REPOSITORY_KEY

static final java.lang.String RRD_REPOSITORY_KEY
Interface attribute key used to store the interface's node id

See Also:
Constant Field Values

THRESHOLD_MAP_KEY

static final java.lang.String THRESHOLD_MAP_KEY
Interface attribute key used to store configured thresholds

See Also:
Constant Field Values

NODE_ID_KEY

static final java.lang.String NODE_ID_KEY
Interface attribute key used to store the interface's node id

See Also:
Constant Field Values

m_svcName

private java.lang.String m_svcName
Specific service that this thresholder is responsible for latency threshold checking.


m_host

private java.lang.String m_host
Local host name

Constructor Detail

LatencyThresholder

LatencyThresholder()
Method Detail

serviceName

public java.lang.String serviceName()

Returns the name of the service that the plug-in threshold checks.

Returns:
The service that the plug-in collects.

initialize

public void initialize(java.util.Map parameters)

Initialize the service thresholder.

Specified by:
initialize in interface ServiceThresholder
Parameters:
parameters - Parameter map which contains (currently) a single entry, the name of the service which this thresholder is responsible for latency threshold checking keyed by the String "svcName"
Throws:
java.lang.RuntimeException - Thrown if an unrecoverable error occurs that prevents the plug-in from functioning.

release

public void release()
Responsible for freeing up any resources held by the thresholder.

Specified by:
release in interface ServiceThresholder

initialize

public void initialize(NetworkInterface iface,
                       java.util.Map parameters)
Responsible for performing all necessary initialization for the specified interface in preparation for thresholding.

Specified by:
initialize in interface ServiceThresholder
Parameters:
iface - Network interface to be prepped for thresholding.
parameters - Key/value pairs associated with the package to which the interface belongs..

release

public void release(NetworkInterface iface)
Responsible for releasing any resources associated with the specified interface.

Specified by:
release in interface ServiceThresholder
Parameters:
iface - Network interface to be released.

check

public int check(NetworkInterface iface,
                 EventProxy eproxy,
                 java.util.Map parameters)
Perform threshold checking.

Specified by:
check in interface ServiceThresholder
Parameters:
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.

checkRrdDir

private void checkRrdDir(java.io.File directory,
                         int nodeId,
                         java.net.InetAddress ipAddr,
                         int interval,
                         java.util.Date date,
                         java.util.Map thresholdMap,
                         Events events)
                  throws java.lang.IllegalArgumentException
Performs threshold checking on an directory which contains one or more RRD files containing latency/response time information. ThresholdEntity objects are stored for performing threshold checking.

Parameters:
directory - RRD repository directory
nodeId - Node identifier of interface being checked
ipAddr - IP address of the interface being checked
interval - Configured thresholding interval
date - Source for timestamp to be used for all generated events
thresholdMap - Map of configured interface level ThresholdEntity objects keyed by datasource name.
events - Castor events object containing any events to be generated as a result of threshold checking.
Throws:
java.lang.IllegalArgumentException - if path parameter is not a directory.

createEvent

private Event createEvent(int nodeId,
                          java.net.InetAddress ipAddr,
                          double dsValue,
                          Threshold threshold,
                          java.lang.String uei,
                          java.util.Date date)
Creates a new threshold event from the specified parms.

Parameters:
nodeId - Node identifier of the affected interface
ipAddr - IP address of the affected interface
dsValue - Data source value which triggered the threshold event
threshold - Configured threshold
uei - Event identifier
date - source of event's timestamp
Returns:
new threshold event to be sent to Eventd

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.