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:
- title - A short description of the alert
- severity - One of alert.INFO, alert.ERROR or alert.CRITICAL
- errorcode - An errorcode that is used by the alerter module to perform actions on the alert
- component - The component or area that raised the alert (for example normalisation, validation, inactivity etc)
- timestamp - The time at which the alert was raised (if not specified then this defaults to the current machine time)
- description - A longer description of the alert (optional)
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)
|
| 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...
|
|
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"
Send this alert.
- Parameters
-
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 |