network.detectors
Class RunawayProcessEventDetector

java.lang.Object
  |
  +--network.detectors.EventDetector
        |
        +--network.detectors.RunawayProcessEventDetector
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class RunawayProcessEventDetector
extends EventDetector
implements java.io.Serializable

Detects if a user process has been running for too long. Will detect if the process is consuming to much of the CPU, or if it has too many threads, when implemented Keeps track of how long a process has been running, what percentage of the CPU the process is using, and how many lwp's the process is running Default maximum run time is 1 day, CPU threshold is 20%, and lwp threshold is 200

See Also:
Serialized Form

Field Summary
private  double cpuThreshold
           
private  java.lang.String[] defaultLocalTriggeringEvents
           
private static int hrt
           
private  java.util.Vector ignoreList
           
private  long lastTime
           
private  int lwpThreshold
           
private  long oneDay
           
private  java.util.Vector processVector
           
 
Fields inherited from class network.detectors.EventDetector
agentURN, attempts, cred, dbModule, eventIDGenerator, eventTable, host, localTriggeringEvents, printRunningThreadsFlag, remoteTriggeringEvents, reportTable
 
Constructor Summary
RunawayProcessEventDetector(ConfigObject configObj)
          Instantiates the detector with default triggering events and default threshold information
RunawayProcessEventDetector(java.lang.String ignoreListFile, ConfigObject configObj)
           
 
Method Summary
private  void constructIgnoreList(java.lang.String filename)
           
 java.util.Vector generateEvent(network.events.Event triggeredEvent)
          Detects if a process has exceeded any threshold values for running time, CPU usage, or lwp count This is accomplished by checking if the process contained in the triggeredEvent has exceeded the thresholds.
 java.lang.String getGeneratingEventClassName()
          Returns the name of the event that this detector generates
 
Methods inherited from class network.detectors.EventDetector
getAlarmLevel, getAlertLevel, getLocalTriggeringEventClassNames, getRemoteTriggeringEventClassNames, getSynchronizer, InitializeFields, modifyDetector, populatePatterns, printRunningThreads, run, setAgentURN, setAlarmLevel, setAlertLevel, setDB, setEventIDGenerator, setEventTable, setLocalTriggeringEvents, setRemoteTriggeringEvents, setReportTable, stopDetector, switchOffPrintRunningThreads
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cpuThreshold

private double cpuThreshold

lwpThreshold

private int lwpThreshold

oneDay

private long oneDay

processVector

private java.util.Vector processVector

lastTime

private long lastTime

ignoreList

private java.util.Vector ignoreList

hrt

private static int hrt

defaultLocalTriggeringEvents

private java.lang.String[] defaultLocalTriggeringEvents
Constructor Detail

RunawayProcessEventDetector

public RunawayProcessEventDetector(ConfigObject configObj)
                            throws java.lang.Exception
Instantiates the detector with default triggering events and default threshold information


RunawayProcessEventDetector

public RunawayProcessEventDetector(java.lang.String ignoreListFile,
                                   ConfigObject configObj)
                            throws java.lang.Exception
Method Detail

getGeneratingEventClassName

public java.lang.String getGeneratingEventClassName()
Returns the name of the event that this detector generates

Specified by:
getGeneratingEventClassName in class EventDetector
Returns:
A String containing the name of the event that this detector generates

generateEvent

public java.util.Vector generateEvent(network.events.Event triggeredEvent)
Detects if a process has exceeded any threshold values for running time, CPU usage, or lwp count This is accomplished by checking if the process contained in the triggeredEvent has exceeded the thresholds. This will ignore processes run by root. Contains a a list of processes that have already triggered a runaway process event, and will ignore those events so they do not cause multiple events. This list of processes is cleared once per day.

Specified by:
generateEvent in class EventDetector
Parameters:
triggeredEvent - The event that triggers this detector. Should be an instance of ProcessMonitoringEvent
Returns:
A vector of events. Each entry corresponds to a runaway process.

constructIgnoreList

private void constructIgnoreList(java.lang.String filename)
                          throws java.io.IOException
java.io.IOException