This how-to will guide you through the process of creating a custom data point that uses an external Python script to retrieve data from devices.
My goal when starting this project was to create a report that would retrieve the upsBasicBatteryLastReplaceDate information that is stored as an OID in our APC UPS's and put it in a report. This is the end result:
I started by creating a custom report (Reports --> Custom Device Reports, click the Reports menu tab, select Add Device Report...). Fill in the Name and Title.
The Path is the first important piece of information you will fill in. The Administration Guide is a bit misleading. It says, "Specify the path in the hierarchy where you want Zenoss to store the report." However, it might more correctly read, "Specify the path in the hierarchy where you want Zenoss to run the report." Basically, the Path defines which devices will be included in the report. I wanted to run this report only on my APC UPS devices, so I defined the Path as /Devices/Power/UPS/APC, since that is the device class path where I put all my APC UPS's. I believe the report will also include any subclasses of the Path too.
What if you wanted to limit the report to only devices in the /Housing Location? That's where the Query field comes in. The report is executed on one device at a time for every device under the defined Path. For each iteration, the here object is defined to point to the current device. This is apparently a function of TALES. Some info can be found here (http://wiki.zope.org/ZPT/TALESSpecification13). Attributes and properties of the device can be accessed
Next I defined the data that I wanted to include in the report. The ID, IP Address, and Location data are already stored in the ZopeDB.