8.10. Object Properties¶
Some parameters of notification streams can be constructed using the same macros used to construct
alert attributes (see also nw2functions.alert()
). These macros refers properties of the object
that encapsulates the alert and the corresponding device (if any).
$alert.deviceId
device Id for the device that triggered alert. This is valid only for fan-out alerts$alert.deviceName
device name, also valid only for the fan-out alerts$alert.componentIndex
component or interface index, valid only for fan-out alerts$alert.componentName
component or interface name, valid only for fan-out alerts$alert.variable
identifier of the corresponding alerting variable, this can be used to construct urls for graphs$alert.inputVariable
identifier of the corresponding input variable, this can be used to construct urls for graphs. This may not be available, for example when alerting rule used temporary variable.$alert.value
the value of the input variable that triggered alert$alert.key
unique deduplication key for the alert$alert.fanout
true or false, indicates whether this is a fan-out alert$alert.tags
a set of strings. For fan-out alerts this is a copy of tags from the input variable that triggered alert. For non fan-out alert this is a common set of tags from all input variable instances that contributed to the alert.$alert.tagsMap
a dictionary where the key is a tag facet and the value is a list of tags in that facet. You can use it to get tags only in specific facet, e.g. $alert.tagsMap.Role will return list of roles of the device that triggered the alert.$alert.activeSince
a time stamp (time in milliseconds) when alert entered state “active”$alert.activeSinceStr
time when alert entered state “active” as a string in time zone specified by the main configuration file parameter network.display.tz$alert.getTags("facet")
returns tags in given facet (both facet and tag word, e.g. “BGP4Peer.AS1000”)$alert.getTagWords("facet")
returns tags in given facet, but unlike$alert.getTags("facet")
, returns only tag words.$alert.details
returns a dictionary passed as argument details to functionnw2functions.alert()
Properties of the object returned by $device (note that some of the properties have two names):
$device.name
device name$device.reverse_dns
reverse DNS (PTR) record for the device’s management address$device.sys_name
system name defined in SYSTEM MIB$device.location
location defined in the SYSTEM MIB$device.contact
contact name defined in the SYSTEM MIB$device.description
“system description” returned by SYSTEM:sysDescr OID$device.sys_descr
“system description” returned by SYSTEM:sysDescr OID$device.box_descr
“box description”: usually model name and number$device.boxdescr
“box description”: usually model name and number$device.sw_rev
software revision$device.hostname
host name as defined on the device$device.address
management address of the device$device.deviceaddress
management address of the device$device.tags
set of this device tags