Represents NetXMS event object.
code ⇒ Integer
-
Event code
customMessage ⇒ String
-
Custom message set in event processing policy by calling
setMessage
. Deprecated and will be removed in a future version. dci ⇒ DCI
-
DCI object of class [class-dci] that is source for this event or NULL if generated not by threshold
dciId ⇒ Integer
-
DCI id that is source for this event or 0 if generated not by threshold
id ⇒ Integer
-
Unique event identifier.
lastAlarmKey ⇒ String
-
Key for last generated alarm for this event or null
message ⇒ String
-
Event message. Get/set attribute.
name ⇒ String
-
Event name.
origin ⇒ Integer
-
Origin of the event
-
0 - SYSTEM
-
1 - AGENT
-
2 - CLIENT
-
3 - SYSLOG
-
4 - SNMP
-
5 - NXSL
-
6 - REMOTE_SERVER
-
originTimestamp ⇒ Integer
-
The time when the event was generated in the origin.
parameters ⇒ Array
-
List of event parameters. Starting index is 1.
parameterNames ⇒ Array
-
List of named event parameters (e.g. "dciId"), which can be accessed by
object.parameterName
. rootId ⇒ Integer64
-
Id of event that is root cause of this event or 0 if there is no such event.
severity ⇒ Integer
-
Event severity code. Get/set attribute.
source ⇒ NetObj
-
Source object (inherited from [class-netobj], exact type can be checked with [func-classof] function) for the event.
sourceId ⇒ Integer
-
ID of the source object for the event.
tags ⇒ Array
-
Event tags as an array of strings.
tagList ⇒ String
-
Event tags as a coma separated list.
timestamp ⇒ Integer
-
Unix timestamp of the event.
$1…$n
-
Shortcut for
parameters[n]
(e.g. "$event.parameters[3]" can be replaced with "$event.$3"). $…
-
Named event parameters can be accessed directly by the name (e.g
$event.dciId
). List of available named parameters can be accessed withparameterNames
attribute. Get/set attribute.
addParameter(name, value) ⇒ void
-
Set event parameter
name |
String |
Parameter name. Optional parameter. |
value |
String |
Parameter value. |
addTag(tag) ⇒ void
-
Set event tag, which can be later accessed via
tags
attribute.
tag |
String tag |
correlateTo(eventId) ⇒ void
-
Sets root cause id for the event
eventId |
Root cause event id |
expandString(string) ⇒ String
-
Expand string by replacing macros with their values.
string |
String to expand |
Formated string
>>> $event.expandString("%N") SYS_THRESHOLD_REACHED
getParameter(name) ⇒ void
-
Get parameter value by name or by index
name |
Parameter name or index |
Parameter value or null
hasTag(tag) ⇒ Boolean
-
Return if event has specific tag.
tag |
String tag |
removeTag(tag) ⇒ void
-
Remove tag from event tag list
tag |
String tag |
setMessage(message) ⇒ void
-
Set event message to
message
.
message |
Message string |
setNamedParameter(name, value) ⇒ void
-
Set named parameter or change value of existing named parameter
name |
String name of parameter |
value |
String value of parameter |
setParameter(index, value) ⇒ void
-
Set value of parameter or change value of existing parameter. If index corresponds to existing parameter, the value will be set. If index is higher then existing number of parameters, new parameter(s) will be added (if needed, parameters with empty values will be added to reach the number of parameters indicated by index).
index |
Integer index of parameter |
value |
String value of parameter |
setSeverity(severityCode) ⇒ void
-
Change event severity to
severityCode
.
severityCode |
Numeric severity code |
toJson() ⇒ String
-
Serialize object to JSON.
String representation of the object in JSON format.