Skip to main content

%Monitor.Alert

Class %Monitor.Alert Extends (%Persistent, %CSP.Page) [ Not Hidden, Inheritance = right, System = 3 ]

This class allows user applications to generate an alert using one of the supported external monitoring protocols. See the External() class method for details.

Properties

ApplicationName

Property ApplicationName As %String(TRUNCATE = 1) [ Internal, Required ];

Alert application

Name

Property Name As %String(TRUNCATE = 1) [ Internal, Required ];

Alert name

NotifyOnce

Property NotifyOnce As %Boolean [ InitialExpression = 0, Internal ];

Alert once
If FALSE (the default) the alert is notified each time the alert is signalled.
If TRUE the alert is only notified once.

Notified

Property Notified As %Boolean [ InitialExpression = 0, Internal, Transient ];

If TRUE the alert has been notified.

Activated

Property Activated As %Boolean [ InitialExpression = 1, Internal ];

Flag indicating if this alert is active

AlertAction

Property AlertAction As %Integer [ InitialExpression = 0, Internal ];

Alert action

MetricClass

Property MetricClass As %String [ Internal ];

Metrics class

MetricApp

Property MetricApp As %String [ Internal ];

Metric application

MetricGroup

Property MetricGroup As %String [ Internal ];

Metric group

PropertyList

Property PropertyList As %String(MAXLEN = 132) [ Internal ];

Metrics property list
A comma-separted string of property names whose values are passed as a list to the evaluation method

EvalMethod

Property EvalMethod As %String [ Internal ];

Method to be invoked during sampling to determine if an alert should be raised

EvalClass

Property EvalClass As %String [ Internal ];

NotifyMethod

Property NotifyMethod As %String [ Internal ];

Method to be invoked if notify type = METHOD [optional]

Expression

Property Expression As %String(MAXLEN = 132) [ Internal ];

Expression to be evaluated [optional]

NotifyClass

Property NotifyClass As %String [ Internal ];

ItemGroup

Property ItemGroup As %Monitor.ItemGroup [ Internal, Transient ];

Application

Relationship Application As %Monitor.Application [ Cardinality = parent, Internal, Inverse = Alert ];

The application definition for this group

Methods

Create

ClassMethod Create(name As %String = "", appname As %String = "", action As %Integer = 0, nmethod As %String = "", nclass As %String = "", mclass As %String = "", prop As %String = "", expr As %String = "", once As %Boolean = 0, evalmethod As %String = "") As %Status [ Internal ]

Unique key index for alert

Delete

ClassMethod Delete(name As %String = "", appname As %String = "") As %Status [ Internal ]

Delete an alert

Check

Method Check() As %Status [ Internal ]

Validate the alert definition

GetId

ClassMethod GetId(name As %String, ByRef id As %String) As %Status [ Internal ]

Returns the object id for the alert

External

ClassMethod External(type As %String = "SNMP", appname As %String = "", severity As %Integer = 0, msg As %String = "") As %Status

This class method allows a application to send an alert using an external monitoring or management interface, currently just SNMP. This call may be used within the Alert Evaluation Method to forward alerts generated by the Monitor, or from anywhere within the application itself to simply create an SNMP Trap.

The parameters used are:

type = use 'SNMP' to indicate how to send the alert

appname = a brief string (MAXLEN=20) to identify the source or application creating the alert

severity = a severity code where 0=info, 1=warning, 2=severe, 3=fatal

msg = a text message (MAXLEN=1024) which describes the problem or event

For SNMP, the alert is sent using the cacheAppAlert trap, with each of the parameters attached as auxiliary objects (see the ISC-CACHE.MIB).