TALES reference
Use TALES syntax to retrieve values and call methods on Collection Zone objects. Several areas accept TALES syntax; these include:
Command templates
User commands
Notifications
zLinks
Commands (those associated with devices and those associated with events) can use TALES expressions to incorporate data from the related devices or events. TALES is a syntax for specifying expressions that let you access the attributes of certain objects, such as a device or an event.
For additional documentation on TALES syntax, see the TALES section of the Zope Page Templates Reference.
Depending on context, you may have access to a device, an event, or both. Following is a list of the attributes and methods you may want to use on device and event objects. The syntax for accessing device attributes and methods is ${dev/attributename}. For example, to get the manageIp of a device you would use ${dev/manageIp}. For events, the syntax is ${evt/attributename}.
A command to ping a device might look like this. (The ${..} is a TALES expression to get the manageIp value for the device.)
ping -c 10 ${device/manageIp}
Expression examples
To use these expressions effectively, you must know which objects, attributes, and methods are available, and in which contexts. Usually there is a device that allows you to access the device in a particular context. Contexts related to a particular event usually have event defined.
DNS Forward Lookup
This example assumes device/id is a resolvable name.
host ${device/id}
DNS Reverse Lookup
host ${device/manageIp}
SNMP Walk
snmpwalk -v 2c -c${device/zSnmpCommunity} ${device/manageIp} system
Device attributes
The following table lists available device attributes.
Attribute | Description |
|---|---|
| The primary means of identifying a device within the system. |
| The IP address used to contact the device in most situations. |
| The production status of the device: Production, Pre-Production, Test, Maintenance, or Decommissioned. This attribute is a numeric value; use |
| Returns a textual representation of |
| The agent returned from SNMP collection. |
| The description returned by the SNMP agent. |
| The OID returned by the SNMP agent. |
| The contact returned by the SNMP agent. |
| The system name returned by the SNMP agent. |
| The location returned by the SNMP agent. |
| When SNMP collection was last performed on the device. This is a DateTime object. |
| Textual representation of |
| The slot name or number in the rack where this physical device is installed. |
| User-entered comments regarding the device. |
| A numeric value: 0 (Trivial), 1 (Lowest), 2 (Low), 3 (Normal), 4 (High), 5 (Highest). |
| A textual representation of the priority. |
| Name of the manufacturer of this hardware. |
| Name of this physical product. |
| Used to associate this device with a hardware product class. |
| Name of the manufacturer of this device's operating system. |
| Name of the operating system running on this device. |
| Used to associate the operating system with a software product class. |
| Serial number for this physical device. |
| Name of the location assigned to this device. |
| Link to the system page for the assigned location. |
| A list of names of the systems this device is associated with. |
| A list of names of the groups this device is associated with. |
| When the last change was made to this device. |
| Uptime returned from SNMP. |
| Textual representation of the SNMP uptime for this device. |
| Textual representation of the ping status of the device. |
| Textual representation of the SNMP status of the device. |
Event attributes
The following table lists available event attributes.
Attribute | Description |
|---|---|
| Collector name from which the event came (such as |
| Component of the associated device, if applicable (for example, |
| Number of times this event has been seen. |
| Key used to correlate duplicate events. By default, this is: |
| ID of the associated device, if applicable. |
| Device class from device context. |
| Device systems from device context, separated by |
| Event class associated with this event. If not specified, may be added by the rule process. If this fails, defaults to |
| Key by which rules processing begins. Often equal to |
| Logical group of event source (such as |
| Primary criteria for mapping events into event classes. Use if a component needs further de-duplication specification. |
| State of the event: 0 = new, 1 = acknowledged, 2 = suppressed. |
| Unique ID for the event. |
| Syslog facility, if this is a syslog event. |
| UNIX timestamp when the event is received. |
| IP address of the associated device, if applicable. |
| Last time this event was seen and its count incremented. |
| Device location from device context. |
| Full message text. |
| Collector name from which this event came. Not the FQDN. |
| NT event ID, if this is an NT eventlog event. |
| Syslog priority, if this is a syslog event. |
| Production state of the device context. |
| The event severity level. |
| The severity of the event expressed as a string: |
| Time the database record for this event was last modified. |
| Text description of the event. Limited to 255 characters. |
| ID of the event that suppressed this event. |
| Device systems from device context, separated by |
Configuration properties and custom properties are also available for devices, and use the same syntax as shown in the previous sections.