Device attributes describe each device, and like the event attributes in Appendix A, Event Attributes not all attributes will apply to every device. We use device attributes to extract bits of information in the following places:
Your programming context determines how you access the device attributes. For example, we can substitute the device attributes in our Python statements via TALES expressions.
An example of a TALES expression to access a device attribute looks like this:
${dev/attribute}
So if we wanted to write a TALES expression to access the name of the device, the expression would look like this: ${dev/getId}
. Python evaluates the expression and substitutes the value into the current Python statement.
In other programming contexts where you might not use TALES, you would use the following syntax to access the event attribute:
device.attribute
The following table includes a list of the attributes that we may use when working with our devices. If you recall our work with custom device reports in Chapter 11, Writing Custom Device Reports, you know this is not an exhaustive list of device attributes that we access. In Chapter 11, Writing Custom Device Reports, we used zendmd
to explore and find device attributes. However, the attributes listed correspond closely to the fields found on the device's Configuration Properties:
id |
The device name, which is not necessarily the fully qualified domain name. |
---|---|
manageIp |
The IP address of the device. |
productionState |
The numeric value of the device's production state:
|
productionStateString |
The device's production state as a human-readable string. |
priority |
The numeric priority value:
|
priorityString |
The device's priority as a human-readable string. |
locationName |
The location organizer assigned to the device. |
systemNames |
The list of system organizers assigned to the device. |
groupNames |
The list of group organizers assigned to the device. |
snmpDescr |
The SNMP Description. |
snmpOID |
The OID from SNMP. |
snmpContact |
The SNMP contact value. |
snmpSysName |
The system name from SNMP. |
snmpLastCollection |
The last time Zenoss collected SNMP data for the device. |
comments |
User-entered comments on the device. |
uptimeStr |
The uptime values for the device. |
pingStatusString |
The device's ping status:
|
snmpStatusString |
The device's SNMP status:
|
osVersion |
The operating system version. |
osProductName |
The software product name defined on the device's edit page. |
osManufactureName |
The operating system manufacturer name defined on the device's edit page. |
hwProductName |
The hardware product name defined on the device's edit page. |
hwManufacturerName |
The hardware manufacturer name defined on the device's edit page. |
3.147.85.183