Reactions and Alerts

IxoraRMS allows the user to create complex rules to trigger reactions such as visual alerts, emails or the execution of custom jobs. Note that a data view does not have to be plotted in order for its reaction to be triggered as long as it is enabled. All reaction events will be stored in the "Reaction Log" but if the data view is also plotted any reaction event will be reflected on the control itself as shown in the figure below.

Reactions can be disabled from the "Actions\Disable Reactions" menu.

Reaction Editor

Reactions can be defined inside the definition of a data view between the query tags. When editing the data view click on the 'Insert Reaction' button to open the reaction editor which will create the XML text for the reaction's definition.

  • Parameters: these are the counters which are available for the definition of this reaction.
  • Severity: the severity of this reaction; used as a sorting filter in the "Reaction Log" tables.
  • Arm Code: the java code that triggers the arming of this reaction; the reaction will be armed if the boolean value returned by this piece of code is true.
  • Fire Code: the java code that triggers all the deliveries mechanisms defined in "Delivery Code" section; the reaction will be triggered if the piece of code returns true. In this example the reaction will be triggered if it stayed armed for more than 60 seconds.
  • Disarm Code: the java code that disarms this reaction; it will only be executed when the reaction is armed. In this example the reaction will be disarmed if the arm condition will not be satisfied for more than 20 seconds. The piece of code must return a boolean.
  • Delivery Code: the java code that invokes a set of reaction delivery methods. In this example the reaction will be delivered through email and by executing the job with the given name from the Job Library.
  • Message Code: the java code that returns the message attached to this reaction. The piece of code must return a java.lang.String.
  • Advise Code: the java code that returns the advice message. This field is not required. The piece of code must return a java.lang.String. If this reaction triggers an advice than this message will be available in the "Reaction Log" under the "Advice" tab.

As you noticed for the previous example in the java code you have available an environment parameter called 'env' which exposes the following methods:

/**

* @return the timestamp when the reaction was armed for the first time

*/

long getArmedTime();

/**

* @return the number of seconds since the reaction was armed

*/

long getSecondsSinceArmed();

/**

* @return the number of times the reaction was armed.

*/

long getArmedCount();

/**

* @return the number of times the reaction was fired.

*/

long getFiredCount();

/**

* @return the timestamp when the reaction was last armed

*/

long getLastArmedTime();

/**

* @return the number of seconds since the reaction was last armed

*/

long getSecondsSinceLastArmed();

/**

* @param id

* @return the translated path of the resource path with the given id

*/

String getPath(String id);

/**

* @param id

* @return the name of the host for the resource with the specified id

*/

String getHost(String id);

/**

* @param id

* @return the name of the agent for the resource with the specified id

*/

String getAgent(String id);

/**

* @param id

* @return the name of the part <code>i</code> of the entity for the resource with the specified id

*/

String getEntityPart(String id, int i);

/**

* @param id

* @return the translated path of the entity for the resource with the specified id

*/

String getEntityPath(String id);

/**

* @param id

* @return the translated name of the counter for the resource with the specified id

*/

String getCounter(String id);

/**

* Invoked by code fragments to send email.

*/

void email();

/**

* Invoked by code fragment to run jobs.

* @param jobLibraryId

*/

void job(String jobLibraryId);

/**

* Writes the given message to the application's log.

* @param logMsg

*/

void log(String logMsg);

/**

* Store a custom object for later retrieval.

* @param key

* @param obj

*/

void put(String key, Serializable obj);

/**

* Retrieves an object that was previously stored with <code>put(String, Serializable)</code>.

* @param key

* @return

*/

Serializable get(String key);


Reaction Log

All reactions events (armed, fired, disarmed) that occured during the current monitoring session are available in the Reaction Log dialog which is accesibe during a monitoring session from the 'View/Reaction Log' menu.

Reaction Cool Down Period

The rection cool down period is the amount of time in seconds that a reaction is disabled after it was fired. This is useful to avoid triggering multiple reactions during a realtively short period of unusual activity. This value can be configured from the 'Configuration/Settings' menu.