MetricAlarm

A MetricAlarm object represents an alert to be sent to a remote system.

Properties

  • String appName: (Required) Name of the application to which this alert applies.

  • String collectorName: Name of the collector this alert is associated with.

  • java.util.Date timestamp: (Required) Time when this alert occurred.

  • String severity: (Required) Severity of the alarm (see mtrics.constants Severities.

  • String description: Description of the alarm.

  • integer id: (Required) Identifier for this alert.

  • java.util.Map generalProperties: Other properties for the alarm.

Methods

  • String toString(): Returns a string representation of this event.

  • Boolean isValid(): Returns True if object contains all required data and all provided data is valid. If False is returned, the logs include details of the error.

Description

A MetricAlarm object represents an alert to be sent to a remote system. This is a general purpose mechanism and the necessary content of the alarm is based on the needs of the system receiving the alarm. (HVM does not currently support Operations Center alarms.)

Example

metrics.onMemberRefused=handleRefused;

function handleRefused(memberData)
{    
   var alarm = metrics.createTecAlarm();
   alarm.id= memberData.id.hashCode();
   alarm.appName='HVM Group Status';
   alarm.timestamp = new java.util.Date();
   alarm.severity = metrics.constants.SEV_CRITICAL;
   alarm.description= memberData.id + ' refused control by ' + metrics.getLocalMember().id;
   metrics.sendAlarm(alarm);
}