network.detectors
Class CPUMonitorEventDetector

java.lang.Object
  extended bynetwork.detectors.EventDetector
      extended bynetwork.detectors.CPUMonitorEventDetector
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class CPUMonitorEventDetector
extends EventDetector
implements java.io.Serializable

The CPUMonitorEvent Detector generates a list of all currently running processes and respective statistics on a monitored host, using the UNIX `ps' command. This detector may be triggered by calling its generateEvent method.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class network.detectors.EventDetector
agentURN, cred, dbModule, eventIDGenerator, eventTable, host, localTriggeringEvents, remoteTriggeringEvents, reportTable
 
Constructor Summary
CPUMonitorEventDetector(ConfigObject configObj)
          The default constructor.
 
Method Summary
 java.util.Vector executeSystemCommand(java.lang.String command)
          Executes the specified command in a new process.
 java.util.Vector generateEvent(Event triggeredEvent)
          Generates a CPUMonitor Event containing the current processes and respective statistics for each process on the monitored host.
 java.lang.String getGeneratingEventClassName()
          Returns the event classname that this detector may generate.
 java.util.Vector parseCommandResults(java.util.Vector results)
          Parses the output from the command in this class' generateEvent method and returns a vector of Object arrays that represents the elements of the string separated.
 
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
 

Constructor Detail

CPUMonitorEventDetector

public CPUMonitorEventDetector(ConfigObject configObj)
The default constructor. Creates a new CPUMonitorEvent Detector that can be triggered by any of the default triggering events.

Method Detail

getGeneratingEventClassName

public java.lang.String getGeneratingEventClassName()
Returns the event classname that this detector may generate.

Specified by:
getGeneratingEventClassName in class EventDetector
Returns:
the fully-qualified classname of the event that this detector may generate.

executeSystemCommand

public java.util.Vector executeSystemCommand(java.lang.String command)
Executes the specified command in a new process.

Parameters:
command - command to be run
Returns:
a vector containing the lines of the resulting output.

parseCommandResults

public java.util.Vector parseCommandResults(java.util.Vector results)
Parses the output from the command in this class' generateEvent method and returns a vector of Object arrays that represents the elements of the string separated.

Parameters:
results - the vector in which to store `ps' output data.
Returns:
a vector containing a ProcessData object.

generateEvent

public java.util.Vector generateEvent(Event triggeredEvent)
Generates a CPUMonitor Event containing the current processes and respective statistics for each process on the monitored host.

Specified by:
generateEvent in class EventDetector
Parameters:
triggeredEvent - the event that triggered this detector.
Returns:
the vector of generated events.