[xymon] hobbitgraph.cgi: Attempting to reuse 'mysqlht'
Henrik Størner
henrik at hswn.dk
Mon Nov 29 22:54:47 CET 2010
On Sun, 28 Nov 2010 16:30:39 +0200, Arie Skliarouk wrote:
> On Thu, Nov 25, 2010 at 17:59, Henrik Størner <henrik at hswn.dk> wrote:
>
>> On Wed, 24 Nov 2010 16:12:07 +0200, Arie Skliarouk wrote:
>>
>> > I created a custom mysql parameters check that shows graphs on one
>> > server, but not on the other. hobbitgraph.sh (hobbitgraph.cgi?) kept
>> > sending following error instead of the actual image:
>> > <html><head><title>Invalid request</title></head> <body>Attempting to
>> > reuse 'mysqlht'</body></html>
>>
>> This is an error from the rrdtool library. So I would suspect something
>> dodgy with the graph-definition in hobbit-graphs.cfg, or the RRD file
>> data is not as you would expect.
>>
>> Could you show us the graph definition you use ?
>
>
> See attached.
OK, the interesting part of your graph definition looks like this:
[mysql]
FNPATTERN mysql.rrd
TITLE MySQL
YAXIS Number
DEF:mysqlht=@RRDFN@:mysqlht:AVERAGE
DEF:mysqlhs=@RRDFN@:mysqlhs:AVERAGE
DEF:mysqlhq=@RRDFN@:mysqlhq:AVERAGE
LINE2:mysqlht#00CCCC:MySQL threads
LINE2:mysqlhs#ff0000:Slow queries
LINE2:mysqlhq#ff00ff:Queries per sec
The problem occurs because you're using an FNPATTERN definition, but you
only expect one file to match. I'll bet that the problem host has another
RRD file present which matches "mysql.rrd" - there is no anchor in the
pattern, so a file "blablamysql.rrd" will also match this pattern. Or
even "mysql.rrd.old".
When you have multiple files that match FNPATTERN, the rest of the
definition is repeated for each file when Xymon tells RRDtool how to
generate the graph. So you'll end up with two DEF lines that define a
"mysqlht" variable - one for each file that matches FNPATTERN. That
is not allowed, and causes RRDtool to complain with the error you see.
If you only want to use one specific RRD file, don't use FNPATTERN.
Instead, put the filename where you have "@RRDFN@" now:
[mysql]
TITLE MySQL
YAXIS Number
DEF:mysqlht=mysql.rrd:mysqlht:AVERAGE
DEF:mysqlhs=mysql.rrd:mysqlhs:AVERAGE
DEF:mysqlhq=mysql.rrd:mysqlhq:AVERAGE
LINE2:mysqlht#00CCCC:MySQL threads
LINE2:mysqlhs#ff0000:Slow queries
LINE2:mysqlhq#ff00ff:Queries per sec
Just for the record, if you DO want to match multiple files, then you
must include the index-number in the DEF and GPRINT definition. E.g.
[mysql]
FNPATTERN mysql.rrd
TITLE MySQL
YAXIS Number
DEF:mysqlht at RRDIDX@=@RRDFN@:mysqlht:AVERAGE
DEF:mysqlhs at RRDIDX@=@RRDFN@:mysqlhs:AVERAGE
DEF:mysqlhq at RRDIDX@=@RRDFN@:mysqlhq:AVERAGE
LINE2:mysqlht at RRDIDX@#@COLOR@:@RRDPARAM@ MySQL threads
See e.g. the [la] and [disk] definitions in the standard graphs.cfg /
hobbitgraph.cfg file.
Regards,
Henrik
More information about the Xymon
mailing list