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 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.
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> <oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index> <oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes> <index_order>ifDescr:ifName:ifHwAddr:ifIndex</index_order> <index_order_type>numeric...