This is similar to post http://forums.cacti.net/viewtopic.php?f ... ed#p241125
I cannot see a way to save the that query unless I create it straigh out of the template without any visual modification (aka.. Open: write it down in the box and save. That does NOT work)
information:
Error:Date Thu, 10 Oct 2013 10:00:30 +0000
Cacti Version 0.8.8a
Cacti OS unix
SNMP Version NET-SNMP version: 5.5
RRDTool Version RRDTool 1.3.x
PHP Version 5.3.3
PHP OS Linux
The cache for that device reads:10/10/2013 10:10:40 AM - CMDPHP: Poller[0] Validation Error on field 'rrd_maximum_3843', value '|query_ifSpeed|': Save Failed: Field Input Error (Check Red Fields).
10/10/2013 10:10:40 AM - CMDPHP: Poller[0] Validation Error on field 'rrd_maximum_3844', value '|query_ifSpeed|': Save Failed: Field Input Error (Check Red Fields).
I have spent a week reading all around but I reached the point where I have to ask about it if you can help me?
Host: xxxxxxx , SNMP Query: SNMP - Interface Statistics
Index: 10112 , Field Name: ifSpeed , Field Value: 1000000000
OID: .1.3.6.1.2.1.2.2.1.5.10112
This is obviously Cisco and template "Interface - Traffic"
Also the database shows:
Code: Select all
mysql> SELECT * FROM host_snmp_cache where host_id = 42 and snmp_index = 5004;
+---------+---------------+--------------+-------------------+------------+-------------------------------+---------+
| host_id | snmp_query_id | field_name | field_value | snmp_index | oid | present |
+---------+---------------+--------------+-------------------+------------+-------------------------------+---------+
| 42 | 1 | ifAlias | bn-3:Po3 | 5004 | .1.3.6.1.2.1.31.1.1.1.18.5004 | 1 |
| 42 | 1 | ifDescr | Port-channel4 | 5004 | .1.3.6.1.2.1.2.2.1.2.5004 | 1 |
| 42 | 1 | ifHighSpeed | 2000 | 5004 | .1.3.6.1.2.1.31.1.1.1.15.5004 | 1 |
| 42 | 1 | ifHwAddr | 00:dd:dd:dd:dd:dd | 5004 | .1.3.6.1.2.1.2.2.1.6.5004 | 1 |
| 42 | 1 | ifIndex | 5004 | 5004 | .1.3.6.1.2.1.2.2.1.1.5004 | 1 |
| 42 | 1 | ifName | Po4 | 5004 | .1.3.6.1.2.1.31.1.1.1.1.5004 | 1 |
| 42 | 1 | ifOperStatus | Up | 5004 | .1.3.6.1.2.1.2.2.1.8.5004 | 1 |
| 42 | 1 | ifSpeed | 2000000000 | 5004 | .1.3.6.1.2.1.2.2.1.5.5004 | 1 |
| 42 | 1 | ifType | propVirtual(53) | 5004 | .1.3.6.1.2.1.2.2.1.3.5004 | 1 |
+---------+---------------+--------------+-------------------+------------+-------------------------------+---------+
and the php file executing all this:
Code: Select all
foreach ($data_sources as $data_source) {
/* use the cacti ds name by default or the user defined one, if entered */
$data_source_name = get_data_source_item_name($data_source["id"]);
if (empty($data_source["rrd_maximum"])) {
/* in case no maximum is given, use "Undef" value */
$data_source["rrd_maximum"] = "U";
} elseif (strpos($data_source["rrd_maximum"], "|query_") !== false) {
/* in case a query variable is given, evaluate it */
$data_local = db_fetch_row("SELECT * FROM data_local WHERE id=" . $local_data_id);
if ($data_source["rrd_maximum"] == "|query_ifSpeed|" || $data_source["rrd_maximum"] == "|query_ifHighSpeed|") {
$highSpeed = db_fetch_cell("SELECT field_value
FROM host_snmp_cache
WHERE host_id=" . $data_local["host_id"] . "
AND snmp_query_id=" . $data_local["snmp_query_id"] . "
AND snmp_index='" . $data_local["snmp_index"] . "'
AND field_name='ifHighSpeed'");
if (!empty($highSpeed)) {
$data_source["rrd_maximum"] = $highSpeed * 1000000;
}else{
$data_source["rrd_maximum"] = substitute_snmp_query_data("|query_ifSpeed|",$data_local["host_id"], $data_local["snmp_query_id"], $data_local["snmp_index"]);
}
}else{
$data_source["rrd_maximum"] = substitute_snmp_query_data($data_source["rrd_maximum"],$data_local["host_id"], $data_local["snmp_query_id"], $data_local["snmp_index"]);
}
} elseif (($data_source["rrd_maximum"] != "U") && (int)$data_source["rrd_maximum"]<=(int)$data_source["rrd_minimum"]) {
/* max > min required, but take care of an "Undef" value */
$data_source["rrd_maximum"] = (int)$data_source["rrd_minimum"]+1;
}
/* min==max==0 won't work with rrdtool */
if ($data_source["rrd_minimum"] == 0 && $data_source["rrd_maximum"] == 0) {
$data_source["rrd_maximum"] = "U";
}
$create_ds .= "DS:$data_source_name:" . $data_source_types{$data_source["data_source_type_id"]} . ":" . $data_source["rrd_heartbeat"] . ":" . $data_source["rrd_minimum"] . ":" . $data_source["rrd_maximum"] . RRD_NL;
}
}
Many thanks