Code: Select all
1,|ds:ssCpuRawIdle|,|ds:ssCpuRawTotal|,/,-,100,*
After that i see errors like this in cacti log:
Code: Select all
04/27/2012 11:20:08 AM - CMDPHP: Poller[0] ERROR: SQL Cell Failed!, Error:'1064', SQL:"SELECT calculated FROM data_source_stats_hourly_last WHERE local_data_id= AND rrd_name='sscpurawtotal'"
04/27/2012 11:20:08 AM - CMDPHP: Poller[0] 4800.4893
You could see below, it uses a different array item $thold['rrd_id'] (others use $thold['rra_id']), which seems to be null. Thus the SQL statement execution fails.
Simply change it to $thold['rra_id'] resolves this problem. And need to comment out the line "cacti_log" to suppress the second line of CMDPHP output.
Code: Select all
$thold_item = db_fetch_row("SELECT thold_data.id, thold_data.graph_id,
thold_data.percent_ds, thold_data.expression,
thold_data.data_type, thold_data.cdef, thold_data.rra_id,
thold_data.data_id, thold_data.lastread,
UNIX_TIMESTAMP(thold_data.lasttime) AS lasttime, thold_data.oldvalue,
data_template_rrd.data_source_name as name,
data_template_rrd.data_source_type_id, data_template_data.rrd_step,
data_template_rrd.rrd_maximum
FROM thold_data
LEFT JOIN data_template_rrd
ON (data_template_rrd.id = thold_data.data_id)
LEFT JOIN data_template_data
ON (data_template_data.local_data_id=thold_data.rra_id)
WHERE data_template_rrd.data_source_name='$dsname'
AND thold_data.rra_id=" . $thold['rra_id'], false); #### <====== look here
if (sizeof($thold_item)) {
$item = array();
$currenttime = 0;
$expression[$key] = thold_get_currentval($thold_item, $rrd_reindexed, $rrd_time_reindexed, $item, $currenttime);
} else {
$value = '';
if (api_plugin_is_enabled('dsstats') && read_config_option("dsstats_enable") == "on") {
$value = db_fetch_cell("SELECT calculated
FROM data_source_stats_hourly_last
WHERE local_data_id=" . $thold['rrd_id'] . " #### <====== look here
AND rrd_name='$dsname'");
}
if (empty($value) || $value == '-90909090909') {
$expression[$key] = get_current_value($thold['rra_id'], $dsname); #### <====== look here
} else {
$expression[$key] = $value;
}
cacti_log($expression[$key]);
}
http://svn.cacti.net/viewvc/thold/branc ... iew=markup
Is it possible a bug? Could someone help to confirm? Thanks.