Appendix B. Device Attributes

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:

  • User commands
  • Event commands
  • Monitoring template commands
  • Event transformations
  • ZenPack programming
  • Custom device reports

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:

  • 1000 = Production
  • 500 = Pre-Production
  • 400 = Test
  • 300 = Maintenance
  • -1 = Decommissioned

productionStateString

The device's production state as a human-readable string.

priority

The numeric priority value:

  • 5 = Highest
  • 4 = High
  • 3 = Normal
  • 2 = Low
  • 1 = Lowest

    0 = Trivial

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:

  • 0 = Up
  • 1 = Down
  • 2 = None

snmpStatusString

The device's SNMP status:

  • 0 = Up
  • 1 = Down
  • 2 = None

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.183