Object Properties ================= Some parameters of notification streams can be constructed using the same macros used to construct alert attributes (see also :func:`nw2functions.alert()`). These macros refers properties of the object that encapsulates the alert and the corresponding device (if any). - :obj:`$alert.deviceId` device Id for the device that triggered alert. This is valid only for fan-out alerts - :obj:`$alert.deviceName` device name, also valid only for the fan-out alerts - :obj:`$alert.componentIndex` component or interface index, valid only for fan-out alerts - :obj:`$alert.componentName` component or interface name, valid only for fan-out alerts - :obj:`$alert.variable` identifier of the corresponding alerting variable, this can be used to construct urls for graphs - :obj:`$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. - :obj:`$alert.value` the value of the input variable that triggered alert - :obj:`$alert.key` unique deduplication key for the alert - :obj:`$alert.fanout` true or false, indicates whether this is a fan-out alert - :obj:`$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. - :obj:`$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. - :obj:`$alert.activeSince` a time stamp (time in milliseconds) when alert entered state "active" - :obj:`$alert.activeSinceStr` time when alert entered state "active" as a string in time zone specified by the main configuration file parameter `network.display.tz` - :obj:`$alert.getTags("facet")` returns tags in given facet (both facet and tag word, e.g. "BGP4Peer.AS1000") - :obj:`$alert.getTagWords("facet")` returns tags in given facet, but unlike :obj:`$alert.getTags("facet")`, returns only tag words. - :obj:`$alert.details` returns a dictionary passed as argument `details` to function :func:`nw2functions.alert()` Properties of the object returned by `$device` (note that some of the properties have two names): - :obj:`$device.name` device name - :obj:`$device.reverse_dns` reverse DNS (PTR) record for the device's management address - :obj:`$device.sys_name` system name defined in SYSTEM MIB - :obj:`$device.location` location defined in the SYSTEM MIB - :obj:`$device.contact` contact name defined in the SYSTEM MIB - :obj:`$device.description` "system description" returned by SYSTEM:sysDescr OID - :obj:`$device.sys_descr` "system description" returned by SYSTEM:sysDescr OID - :obj:`$device.box_descr` "box description": usually model name and number - :obj:`$device.boxdescr` "box description": usually model name and number - :obj:`$device.sw_rev` software revision - :obj:`$device.hostname` host name as defined on the device - :obj:`$device.address` management address of the device - :obj:`$device.deviceaddress` management address of the device - :obj:`$device.tags` set of this device tags