SQL Error

Support questions about the Threshold plugin

Moderators: Developers, Moderators

User avatar
phakesley
Posts: 39
Joined: Tue Nov 13, 2007 11:24 am

workaround (not sure if it actually fixes the problem)

Post by phakesley »

in the plugins/thold directory edit setup.php (first making a backup)
Locate on line 203

$thold_items = db_fetch_assoc("select thold_data.cdef, thold_data.rra_id, thold_data.data_id, thold_data.lastread, thold_data.oldvalue, data_template_rrd.data_source_name as name, data_template_rrd.data_source_type_id from thold_data
LEFT JOIN data_template_rrd on (data_template_rrd.id = thold_data.data_id)
WHERE data_template_rrd.data_source_name != '' AND $rra_ids");

and change to


if ($rrd_ids != '') {
$thold_items = db_fetch_assoc("select thold_data.cdef, thold_data.rra_id, thold_data.data_id, thold_data.lastread, thold_data.oldvalue, data_template_rrd.data_source_name as name, data_template_rrd.data_source_type_id from thold_data
LEFT JOIN data_template_rrd on (data_template_rrd.id = thold_data.data_id)
WHERE data_template_rrd.data_source_name != '' AND $rra_ids");
} else {
$thold_items = db_fetch_assoc("select thold_data.cdef, thold_data.rra_id, thold_data.data_id, thold_data.lastread, thold_data.oldvalue, data_template_rrd.data_source_name as name, data_template_rrd.data_source_type_id from thold_data
LEFT JOIN data_template_rrd on (data_template_rrd.id = thold_data.data_id)
WHERE data_template_rrd.data_source_name != '' ");
}
This removes the SQL error from CACTI log file and does not seem to affect thresholds?
imjames407
Posts: 1
Joined: Thu Apr 30, 2009 4:15 am
Contact:

Nice one

Post by imjames407 »

Its nice one for programmers.
[url=http://www.trustpharma.com]generic viagra[/url],[url=http://www.trustpharma.com/purchase/genericlevitra.asp]generic levitra[/url],[url=http://www.trustpharma.com/purchase/kamagra.asp]kamagra[/url]
cigamit
Developer
Posts: 3369
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

I just have to assume your now using 4.0 (or even 4.1) as this code was moved in that version, and a better fix was added to it.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests