network.detectors
Class MarkFailEventDetector

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

public class MarkFailEventDetector
extends EventDetector

Looks for the MARK message in the syslog file. If the MARK message is not seen in a specified amount of time, a MarkFailEvent will be created This is used to detect if the syslog daemon is down

See Also:
Serialized Form

Field Summary
protected  java.lang.String eventName
          The name of the event
protected  java.util.Vector monthLookup
          Table lookup for number to month name match
 
Fields inherited from class network.detectors.EventDetector
agentURN, cred, dbModule, eventIDGenerator, eventTable, host, localTriggeringEvents, remoteTriggeringEvents, reportTable
 
Constructor Summary
MarkFailEventDetector(ConfigObject configObj)
          Creates a MarkFailEventDetector with the default mark time specified in AdminClient The mark time is the amount of time the detector will wait for a mark event before creating a MarkFailEvent
MarkFailEventDetector(long markTime, ConfigObject configObj)
          Creates a MarkFailEventDetector with the specified mark time specified in AdminClient
MarkFailEventDetector(java.lang.String markTime, ConfigObject configObj)
          Creates a MarkFailEventDetector with the specified mark time specified in AdminClient
 
Method Summary
 java.util.Vector generateEvent(Event triggeredEvent)
          Receives either a TimerEvent or SyslogEvent.
 java.lang.String getGeneratingEventClassName()
          Returns the name of the event that this detector triggers
static java.lang.String[] getParamList()
          Returns array of strings containing all the parameters that can be used as input to modify this detector.
 void modifyDetector(java.lang.Object[] object)
          Allows modification of detector configuration by passing a Long object of milliseconds for the new time out.
static java.lang.Object[] translateParameters(java.lang.String[] inputarray)
          This function takes an array of strings from GUI which contains input and converts them to array of objects and returns.
 
Methods inherited from class network.detectors.EventDetector
getAlarmLevel, getAlertLevel, getLocalTriggeringEventClassNames, getRemoteTriggeringEventClassNames, getSynchronizer, InitializeFields, 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

eventName

protected java.lang.String eventName
The name of the event


monthLookup

protected java.util.Vector monthLookup
Table lookup for number to month name match

Constructor Detail

MarkFailEventDetector

public MarkFailEventDetector(ConfigObject configObj)
Creates a MarkFailEventDetector with the default mark time specified in AdminClient The mark time is the amount of time the detector will wait for a mark event before creating a MarkFailEvent


MarkFailEventDetector

public MarkFailEventDetector(long markTime,
                             ConfigObject configObj)
Creates a MarkFailEventDetector with the specified mark time specified in AdminClient

Parameters:
markTime - The amount of time the detector will wait for a mark event before creating a MarkFailEvent

MarkFailEventDetector

public MarkFailEventDetector(java.lang.String markTime,
                             ConfigObject configObj)
Creates a MarkFailEventDetector with the specified mark time specified in AdminClient

Parameters:
markTime - The amount of time the detector will wait for a mark event before creating a MarkFailEvent. Must be parseable into a long
Method Detail

getParamList

public static java.lang.String[] getParamList()
Returns array of strings containing all the parameters that can be used as input to modify this detector. Each entry in the array corresponds to one parameter with structure " : ".

Returns:
parameterList, an array of Strings indicating parameters and their types

translateParameters

public static java.lang.Object[] translateParameters(java.lang.String[] inputarray)
                                              throws java.lang.Exception
This function takes an array of strings from GUI which contains input and converts them to array of objects and returns.

Parameters:
inputarray - an array of strings that contains user inputs.
Returns:
objArray an array of objects converted from the array of strings got from user.
Throws:
java.lang.Exception

modifyDetector

public void modifyDetector(java.lang.Object[] object)
                    throws java.lang.Exception
Allows modification of detector configuration by passing a Long object of milliseconds for the new time out.

Overrides:
modifyDetector in class EventDetector
Parameters:
object - an array of Objects with a Long object as the only parameter
Returns:
Throws:
java.lang.Exception

getGeneratingEventClassName

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

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

generateEvent

public java.util.Vector generateEvent(Event triggeredEvent)
Receives either a TimerEvent or SyslogEvent. If triggeredEvent is an instance of TimerEvent, this will check to see if the syslog has received a mark message in the amount of time specified in the constructor. If triggeredEvent is an instance of SyslogEvent, this will check to see if a mark message has been written to the syslog and update the time counter.

Specified by:
generateEvent in class EventDetector
Parameters:
triggeredEvent - The event triggering this detector
Returns:
A vector of events this detector creates