Transformer Pipeline Module API Reference  8.0.1.209428-2690cd2c
Alerting routines

Detailed Description

Alerts are a type of datasource message that can be raised by any component within a system. They are captured by the alerter Transformer module which then distributes and/or caches the alerts for use by monitoring software.

An alert consists of the following components:

Additional parameters may be added into an alert using standard table access methods. Identifiers with a leading underscore are reserved.

Example usage:

require("alert")
alert.sendquick(alert.INFO, "CP30", "Pulse", "The title for an alert", "A long description for an alert")
alert.sendquick(alert.INFO, "CP30", "Pulse", "The title for an alert", nil)
alert.sendquick(alert.INFO, nil, "Pulse", "The title for an alert", "A long description for an alert")
alert.sendquick(alert.INFO, nil, "Pulse", "The title for an alert", nil)
a = alert.new()
alert.set_severity(a,alert.ERROR)
alert.set_errorcode(a,"ED83823X")
alert.set_component(a,"JDBCsource")
alert.set_title(a,"Index Validation Error")
alert.set_description(a,"This error occured because some value went out of range blah blah blah")
alert.send(a)
a2 = alert.new()
alert.set_severity(a2,alert.CRITICAL)
alert.set_component(a2,"Reporter")
alert.set_title(a2,"Some Other Error")
alert.send(a)

Functions

 alert.new ()
 Create an alert object, for example: a = alert.new()
 
 alert.set_time (var al, var rhs)
 Set the time for this alert object. More...
 
 alert.set_severity (var al, var rhs)
 Set the severity for this alert object. More...
 
 alert.set_errorcode (var al, var rhs)
 Set the errorcode for this alert object. More...
 
 alert.set_component (var al, var rhs)
 Set the component for this alert object. More...
 
 alert.set_title (var al, var rhs)
 Set the title for this alert object. More...
 
 alert.set_description (var al, var rhs)
 Set the description for this alert object. More...
 
 alert.set_command (var al, var rhs)
 Set the command for this alert object. More...
 
 alert.set_uniqueid (var al, var rhs)
 Set the unqiue identifiers for this alert object. More...
 
 alert.set_id (var al, var rhs)
 Set the identifier for this alert object. More...
 
 alert.set_extra (var al, var key, var value)
 Set an extra value on an alert. More...
 
 alert.send (var al)
 Send this alert. More...
 
 alert.sendquick (var severity, var errorcode, var component, var id, var title, var description, var extra_fields)
 Convenience function to send an alert in one function call. More...
 
 alert.cancelquick (var errorcode, var component, var id)
 Convenience function to cancel an alert in one call. More...
 

Function Documentation

alert.cancelquick ( var  errorcode,
var  component,
var  id 
)

Convenience function to cancel an alert in one call.

Parameters
errorcode- The errorcode
component- The component
id- IdentifierThe component

A unique index will be ructed out of "component"_"errorcode"_"id"

alert.send ( var  al)

Send this alert.

Parameters
al- Alert to send
alert.sendquick ( var  severity,
var  errorcode,
var  component,
var  id,
var  title,
var  description,
var  extra_fields 
)

Convenience function to send an alert in one function call.

Parameters
severity- The severity level, alert.INFO, alert.ERROR or alert.CRITICAL
errorcode- The errorcode
component- The component
id- IdentifierThe component
title- A short title
description- A long description
extra_fields- Extra fields for alert

A unique index will be ructed out of "component"_"errorcode"_"id"

alert.set_command ( var  al,
var  rhs 
)

Set the command for this alert object.

Parameters
al- Alert to modify
rhs- The command

The command is optional, and should be "CANCEL" if an alert needs to be cancelled, all other commands have at present no effect

alert.set_component ( var  al,
var  rhs 
)

Set the component for this alert object.

Parameters
al- Alert to modify
rhs- The component
alert.set_description ( var  al,
var  rhs 
)

Set the description for this alert object.

Parameters
al- Alert to modify
rhs- The description
alert.set_errorcode ( var  al,
var  rhs 
)

Set the errorcode for this alert object.

Parameters
al- Alert to modify
rhs- The errorcode
alert.set_extra ( var  al,
var  key,
var  value 
)

Set an extra value on an alert.

Parameters
al- The alert to modify
key- The key to enter the value under
value- The value to store under the key
alert.set_id ( var  al,
var  rhs 
)

Set the identifier for this alert object.

Parameters
al- Alert to modify
rhs- The symbol identifier
alert.set_severity ( var  al,
var  rhs 
)

Set the severity for this alert object.

Parameters
al- Alert to modify
rhs- The severity (alert.INFO, alert.ERROR or alert.CRITICAL)
alert.set_time ( var  al,
var  rhs 
)

Set the time for this alert object.

Parameters
al- Alert to modify
rhs- The time
alert.set_title ( var  al,
var  rhs 
)

Set the title for this alert object.

Parameters
al- Alert to modify
rhs- The title
alert.set_uniqueid ( var  al,
var  rhs 
)

Set the unqiue identifiers for this alert object.

Parameters
al- Alert to modify
rhs- The unique identifier

Generated on Wed Feb 28 2024 18:03:14 for Transformer Pipeline Module API Reference