Creating data queries

Data queries are more complex than simple data input methods. As already mentioned, they involve indexes. In order for you to get off to an easy start with data queries, you will now rebuild the SNMP-based data query for network interfaces.

Building the XML data file

Building a script or SNMP query always starts with an XML file providing the relationship between input, output, and the index. Look at the interface_book.xml file that comes with this book for an example of such an XML file.

XML header

The XML header sets some generic information for Cacti. A generic description as well as the SNMP OID index can be set here:

<name>Get SNMP Interfaces</name> <description>Queries a host for a list of monitorable interfaces</description> ...

Get Cacti 0.8 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.