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.deviceIddevice Id for the device that triggered alert. This is valid only for fan-out alerts
- $alert.deviceNamedevice name, also valid only for the fan-out alerts
- $alert.componentIndexcomponent or interface index, valid only for fan-out alerts
- $alert.componentNamecomponent or interface name, valid only for fan-out alerts
- $alert.variableidentifier of the corresponding alerting variable, this can be used to construct urls for graphs
- $alert.inputVariableidentifier 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.valuethe value of the input variable that triggered alert
- $alert.keyunique deduplication key for the alert
- $alert.fanouttrue or false, indicates whether this is a fan-out alert
- $alert.tagsa 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.tagsMapa 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.activeSincea time stamp (time in milliseconds) when alert entered state “active”
- $alert.activeSinceStrtime 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.detailsreturns a dictionary passed as argument details to function- nw2functions.alert()
Properties of the object returned by $device (note that some of the properties have two names):
- $device.namedevice name
- $device.reverse_dnsreverse DNS (PTR) record for the device’s management address
- $device.sys_namesystem name defined in SYSTEM MIB
- $device.locationlocation defined in the SYSTEM MIB
- $device.contactcontact 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_revsoftware revision
- $device.hostnamehost name as defined on the device
- $device.addressmanagement address of the device
- $device.deviceaddressmanagement address of the device
- $device.tagsset of this device tags