Skip to content

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
getId The primary means of identifying a device within the system
getManageIp The IP address used to contact the device in most situations
productionState The production status of the device: Production, Pre-Production, Test, Maintenance or Decommisioned. This attribute is a numeric value, use getProductionStateString for a textual representation.
getProductionStateString Returns a textual representation of the productionState
snmpAgent The agent returned from SNMP collection
snmpDescr The description returned by the SNMP agent
snmpOid The oid returned by the SNMP agent
snmpContact The contact returned by the SNMP agent
snmpSysName The system name returned by the SNMP agent
snmpLocation The location returned by the SNMP agent
snmpLastCollection When SNMP collection was last performed on the device. This is a DateTime object.
getSnmpLastCollectionString Textual representation of snmpLastCollection
rackSlot The slot name/number in the rack where this physical device is installed
comments User entered comments regarding the device
priority A numeric value: 0 (Trivial), 1 (Lowest), 2 (Low), 3 (Normal), 4 (High), 5 (Highest)
getPriorityString A textual representation of the priority
getHWManufacturerName Name of the manufacturer of this hardware
getHWProductName Name of this physical product
getHWProductKey Used to associate this device with a hardware product class
getOSManufacturerName Name of the manufacturer of this device's operating system.
getOSProductName Name of the operating system running on this device.
getOSProductKey Used to associate the operating system with a software product class
getHWSerialNumber Serial number for this physical device
getLocationName Name of the Location assigned to this device
getLocationLink Link to the system page for the assigned Location
getSystemNames A list of names of the Systems this device is associated with
getDeviceGroupNames A list of names of the Groups this device is associated with
getLastChangeString When the last change was made to this device
getLastPollSnmpUpTime Uptime returned from SNMP
uptimeStr Textual representation of the SNMP uptime for this device
getPingStatusString Textual representation of the ping status of the device
getSnmpStatusString Textual representation of the SNMP status of the device

Event attributes

The following table lists available event attributes.

Attribute Description
agent Collector name from which the event came (such as zensyslog or zentrap).
component Component of the associated device, if applicable. (Examples: eth0, httpd.)
count Number of times this event has been seen.
dedupid Key used to correlate duplicate events. By default, this is: device, component, eventClass, eventKey, severity.
device ID of the associated device, if applicable.
DeviceClass Device class from device context.
DeviceGroups Device systems from device context, separated by |.
eventClass Event class associated with this device. If not specified, may be added by the rule process. If this fails, then will be /Unknown.
eventClassKey Key by which rules processing begins. Often equal to component.
eventGroup Logical group of event source (such as syslog, ping, or nteventlog).
eventKey Primary criteria for mapping events into event classes. Use if a component needs further de-duplication specification.
eventState State of event. 0 = new, 1 = acknowledged, 2 = suppressed.
evid Unique ID for the event.
facility syslog facility, if this is a syslog event.
firstTime UNIX timestamp when event is received.
ipAddress IP Address of the associated device, if applicable.
lastTime Last time this event was seen and its count incremented.
Location Device location from device context.
message Full message text.
monitor Collector name from which this event came. Note: It is not the FQDN.
ntevid nt event ID, if this is an nt eventlog event.
priority syslog priority, if this is a syslog event.
prodState prodState of the device context.
severity The event severity level.
severityString the severity of the event expressed as a string (Clear, Debug, Info, Warning,Error, or Critical)
stateChange Time the MySQLrecord for this event was last modified.
summary Text description of the event. Limited to 255 characters.
suppid ID of the event that suppressed this event.
Systems Device systems from device context, separated by |.

Configuration properties and custom properties also are available for devices, and use the same syntax as shown in the previous sections.