hobbitgraph.cgi: Attempting to reuse 'mysqlht'
Hi,
Initially I filed my problem as a bug over here: https://sourceforge.net/tracker/?func=detail&aid=3116811&group_id=128058&ati...
but now I am not sure it is a bug, so posting it here for more lively discussion:
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>
If I request the same image for different server, same service - I get the image. If I copy the mysql.rrd file from the /var/lib/hobbit/rrd/atl-db01/mysql.rrd into the /var/lib/hobbit/rrd/pa04, then the image for pa04 shows graph for the atl-db01.
Could be that dash in name of that particular server was affecting the hobbitgraph.cgi somehow? I can attach the hobbitgraph.d/mysql.cfg and hobbitserver.d/mysql.cfg if that would help.
-- Arie
Reposting the message as I received weird undelivery report:
This is an automatically generated Delivery Status Notification.
Delivery to the following recipients failed.
catchall at windowlogic.com.au
-- Arie
On Wed, Nov 24, 2010 at 16:12, Arie Skliarouk <skliarie at gmail.com> wrote:
Hi,
Initially I filed my problem as a bug over here:
https://sourceforge.net/tracker/?func=detail&aid=3116811&group_id=128058&ati...
but now I am not sure it is a bug, so posting it here for more lively discussion:
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>
If I request the same image for different server, same service - I get the image. If I copy the mysql.rrd file from the /var/lib/hobbit/rrd/atl-db01/mysql.rrd into the /var/lib/hobbit/rrd/pa04, then the image for pa04 shows graph for the atl-db01.
Could be that dash in name of that particular server was affecting the hobbitgraph.cgi somehow? I can attach the hobbitgraph.d/mysql.cfg and hobbitserver.d/mysql.cfg if that would help.
-- Arie
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 ? And the layout of the RRD-file - a command like
rrdtool info mysql.rrd |grep "type ="
should give us the necessary info about the datasets and their type.
If I request the same image for different server, same service - I get the image. If I copy the mysql.rrd file from the /var/lib/hobbit/rrd/atl-db01/mysql.rrd into the /var/lib/hobbit/rrd/pa04, then the image for pa04 shows graph for the atl-db01.
Could be that dash in name of that particular server was affecting the hobbitgraph.cgi somehow? I can attach the hobbitgraph.d/mysql.cfg and hobbitserver.d/mysql.cfg if that would help.
It shouldn't, and I know I have hostnames with dash'es in them. Haven't noticed any problems with graphs there, but I'll have a look.
Regards, Henrik
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. Also attached all files you might require to recreate the mysql sensor.
Note that the graph works for one machine, but not for the other.
And the layout of the RRD-file - a command like
rrdtool info mysql.rrd |grep "type ="
Both files yield identical output: ds[mysqlht].type = "GAUGE" ds[mysqlhq].type = "GAUGE" ds[mysqlhs].type = "GAUGE"
-- Arie
should give us the necessary info about the datasets and their type.
If I request the same image for different server, same service - I get the image. If I copy the mysql.rrd file from the /var/lib/hobbit/rrd/atl-db01/mysql.rrd into the /var/lib/hobbit/rrd/pa04, then the image for pa04 shows graph for the atl-db01.
Could be that dash in name of that particular server was affecting the hobbitgraph.cgi somehow? I can attach the hobbitgraph.d/mysql.cfg and hobbitserver.d/mysql.cfg if that would help.
It shouldn't, and I know I have hostnames with dash'es in them. Haven't noticed any problems with graphs there, but I'll have a look.
Regards, Henrik
To unsubscribe from the xymon list, send an e-mail to xymon-unsubscribe at xymon.com
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
Thank you for helpful explanation, after I removed FNPATTERN and replaced @RRDFN@ with mysql.rrd - the graph appeared for the second machine too.
And no, I neither have other mysql*.rrd file in the /var/lib/hobbit/rrd/HOSTNAME/ directory, nor any of the existing ones had keys starting with "mysql" string.
-- Arie
On Mon, Nov 29, 2010 at 23:54, Henrik Størner <henrik at hswn.dk> wrote:
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
To unsubscribe from the xymon list, send an e-mail to xymon-unsubscribe at xymon.com
participants (2)
-
henrik@hswn.dk
-
skliarie@gmail.com