network.detectors
Class DiskFullEventDetector

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

public class DiskFullEventDetector
extends EventDetector
implements java.io.Serializable

This detector watches a number of disk volumes and warns (generates a DiskFullEvent) if the space used is above X percent. A sample file might be:

/usr 20 /tmp 80 /export/scratch 50

where the lvalues are paths, and the rvalues are usage thresholds (percent of volume used).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class network.detectors.EventDetector
agentURN, cred, dbModule, eventIDGenerator, eventTable, host, localTriggeringEvents, remoteTriggeringEvents, reportTable
 
Constructor Summary
DiskFullEventDetector(ConfigObject configObj)
          The default constructor.
DiskFullEventDetector(java.lang.String diskUsageFile, ConfigObject configObj)
          This constructor takes as argument a diskUsageFile, an example of which is shown above.
 
Method Summary
 java.util.Vector executeSystemCommand(java.lang.String command)
          Executes the given command and returns a vector of lines of output.
 java.util.Vector generateEvent(Event triggeredEvent)
           
 java.lang.String getGeneratingEventClassName()
          Returns the fully-qualified classname of the event that this detector may generate.
 java.util.Vector parseCommandResults(java.util.Vector results)
          Parses a vector of command results into a vector of Object arrays that represent the elements of each line (separated by spaces).
static void parseDiskUsagesFile(java.lang.String diskUsageFile, java.util.Hashtable usageThresholds)
          This method parses a diskUsageFile.
 
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

DiskFullEventDetector

public DiskFullEventDetector(ConfigObject configObj)
The default constructor. Creates this detector with a triggering default of network.events.TimerEvent.


DiskFullEventDetector

public DiskFullEventDetector(java.lang.String diskUsageFile,
                             ConfigObject configObj)
This constructor takes as argument a diskUsageFile, an example of which is shown above. This detector is created with a triggering default event of network.events.TimerEvent.

Parameters:
diskUsageFile -
Method Detail

getGeneratingEventClassName

public java.lang.String getGeneratingEventClassName()
Returns the fully-qualified classname of the event 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 given command and returns a vector of lines of output.

Parameters:
command - a command to be executed in a new process.
Returns:
a vector of output lines from the command.

parseCommandResults

public java.util.Vector parseCommandResults(java.util.Vector results)
Parses a vector of command results into a vector of Object arrays that represent the elements of each line (separated by spaces). Basically, this tokenizes each line.

Parameters:
results - the vector of results generated by executeSystemCommand().
Returns:
a vector of Object arrays

generateEvent

public java.util.Vector generateEvent(Event triggeredEvent)
Specified by:
generateEvent in class EventDetector
Parameters:
triggeredEvent -
Returns:

parseDiskUsagesFile

public static void parseDiskUsagesFile(java.lang.String diskUsageFile,
                                       java.util.Hashtable usageThresholds)
This method parses a diskUsageFile. An example file is shown at the top.

Parameters:
diskUsageFile - path to the diskUsageFile
usageThresholds - a Hashtable to be filled with config pairs.
Returns: