Chapter 10. Data Queries
When you are finished filling in these fields, click the Create button. You will be redirected back to the same page with
some additional information to fill in. Cacti will make a list of each data template referenced to in your selected graph
template and display them under the Associated Data Templates box. For each data source item listed, you must selected
the data query output field that corresponds with it. Do not forget to check the checkbox to the right of each selection, or your
settings will not be saved.
The Suggested Values box gives you a way to control field values of data sources and graphs created using this data
query. If you specify multiple suggested values for the same field, Cacti will evaluate them in order which you can
control using the up or down arrow icons. For more information about valid field names and variables, read the
section on suggested values.
When you are finished filling in all necessary fields on this form, click the Save button to return to the data queries edit
screen. Repeat the steps under this heading as many times as necessary to represent all data in your XML file. When
you are finished with this, you should be ready to start adding your data query to hosts.
10.2. SNMP Query XML Syntax
<
query
>
<
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_index_parse
>
OID/REGEXP:.*\.([0 9]{1,3}\.[0 9]{1,3})$
<
/oid_index_parse
>
<
oid_num_indexes
>
.1.3.6.1.2.1.2.1.0
<
/oid_num_indexes
>
<
index_order
>
ifDescr:ifName:ifIndex
<
/index_order
>
<
index_order_type
>
numeric
<
/index_order_type
>
<
index_title_format
>
|chosen_order_field|
<
/index_title_format
>
<
fields
>
<
ifIndex
>
<
name
>
Index
<
/name
>
<
method
>
walk
<
/method
>
<
source
>
value
<
/source
>
<
direction
>
input
<
/direction
>
<
oid
>
.1.3.6.1.2.1.2.2.1.1
<
/oid
>
<
/ifIndex
>
<
/fields
>
<
/query
>
Table 10 3. SNMP Query XML Field Reference
Field
Description
query >name
(Optional) You can enter a "friendly name" for the SNMP query here. It will
not be used by Cacti, and is for identification only.
query >description
(Optional) You can enter a description for the SNMP query here. It will not
be used by Cacti, and is for identification only.
query >oid_index
Every SNMP query must have an OID that represents the index values for
the query when walked. As described above, any data query in Cacti must
contain a field that uniquely identifies each row returned by the query. In
the example above, the oid_index points to the OID of ifIndex in the
interface MIB.
Note: Starting with version 0.8.6c, Cacti is able to parse unique indexes from
the OID itself. While the regular expression used for parsing the value from
the OID is defined below, you must still specify an OID that can be walked
by Cacti in order to obtain the list of OID's. Any OID defined for one of your
input fields should work in this case. The values returned from the snmpwalk
walk will be completely disregarded.
query >oid_index_parse
This field should only be used if you are trying to parse the unique index
from the OID itself. If this field is defined, to obtain a list of indexes, Cacti
walks the OID provided in the oid_index field above. It then applies the
regular expression provided in this field to the list of OID's that are returned.
The matched substrings that remain become the list of indexes for this SNMP
query.
17
<
New Page 1
Php Mysql Web Hosting