cacti-0.6.7: Supplied argument is not a valid MySQL result

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
richjam

cacti-0.6.7: Supplied argument is not a valid MySQL result

Post by richjam »

Hi,
I cant display the graphs for "Apache Web Hits" , "Load Average" or "Apache/Samba/Mysql".
when I view the source for each of these I see the error message:

Warning: Supplied argument is not a valid MySQL result resource in include/rrd_functions.php on line 573

I guess this is the offending piece of code in rrd_functions.php:

$sql_id_cdef_items = mysql_query("select case
when ci.type=\"CDEF Function\" then cf.name
when ci.type=\"Data Source\" then ds.name
when ci.type=\"Custom Entry\" then ci.custom
end 'cdef',
ci.type,ci.dsid,ci.currentds
from rrd_ds_cdef_item ci left join def_cdef cf on cf.id=ci.cdeffunctionid left
join rrd_ds ds on ds.id=ci.dsid
where ci.cdefid=" . mysql_result($sql_id_item, $i, "cdefid") .
" order by ci.sequence",$cnn_id);
$rows_cdef = mysql_num_rows($sql_id_cdef_items); $i_cdef = 0;


The last line is line 573.

Im not sure if this is relevant but if I manually run the rrd commands I see for "Apache Web Hits" I get the following "can't parse CDEF" error:

/opt/RRDtool/bin/rrdtool graph - \
--imgformat=PNG \
--start="-86400" \
--title="Apache Web Hits" \
--rigid \
--base=1000 \
--height=150 \
--width=500 \
--alt-autoscale \
--vertical-label="Hits" \
DEF:a="/opt/apache/htdocs/scsuk/vhost/html/cacti/rra/system_webhits.rrd":system_webhits:AVERAGE \
CDEF:cdefa= \
AREA:cdefa#7EE600:"Web Hits" \
GPRINT:cdefa:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" >ppp.png
ERROR: can't parse CDEF 'cdefa='


This is a Solaris 8 installation.

Any help much appreciated - This looks like a really good front end - thanks,

Rich Jam.
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

This line:

CDEF:cdefa= \

tells me that the CDEF is not being generated for some reason. Are there any CDEF's listed when going into 'CDEF's' under cacti? You can always temporarily fix these graph by manually taking the CDEF out of the graph.

-Ian
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests