mysql graphing ---it should not be this hard

Tom Georgoulias tomg at mcclatchyinteractive.com
Wed May 24 19:49:14 CEST 2006


Hi,

I've been attempting to get the bb-mysqlstat.sh script from deadcat.net 
to collect mysql status data from a DB client, using the Hobbit NCV 
module, and I'm stuck. I can't believe how hard such a seemingly simple 
task ended up being, and I'm still don't have it working right.

I'm using Hobbit 4.1.2p1, and upgrading to the alpha release or a 
snapshot isn't an real option right now since this is my production 
Hobbit server.

- I have added the appropriate configs to hobbitserver.cfg to allow NCV 
to handle mysql data, per Henrik's old post:
http://www.hswn.dk/hobbiton/2005/06/msg00261.html

- I have the bb-mysqlstat.sh script running on the client and the status 
reports are being displayed under the "mysql" column.  No graphs yet, 
just a link for one named "hobbit graph ncv:mysql"  Here's an example 
status report from a devel db:

Wed May 24 11:28:41 EDT 2006 - Mysql OK

Uptime: 687291  Threads: 69  Questions: 9182886  Slow queries: 11762 
Opens: 16846  Flush tables: 1  Open tables: 1757  Queries per second 
avg: 13.361

- I've added YAXIS entries (YAXIS #) for both mysqlslow and mysqlthread 
to hobbitgraphs.cfg.  I took these entries from the hobbitgraphs.cfg 
included in the today's Hobbit snapshot.

- I've added "mysql:mysqlslow,mysqlthread: to my GRAPHS:* entry in bb-hosts.

- Data is being collected in a mysql.rrd file, but this step does not 
appear to be working correctly.  Using "rrdtool fetch mysql.rrd AVERAGE" 
  to inspect the rrd file contents, I see that it only contains 
"Threads, Questions, Slowqueries, Opens, Flushtables, and Opentables".

localhost $ rrdtool fetch mysql.rrd AVERAGE | head -1
timestamp    Threads           Questions         Slowqueries       Opens 
             Flushtables       Opentables

The NCV_mysql="Uptime:NONE,Queriespersecondavg:GAUGE" instructs hobbit 
to drop the uptime value, which it does, but I'm also missing 
Queriespersecondavg.  In addition, it appears that the data in the rrd 
file for each of the variables is incorrect.  If I had to guess, I 
suspect the NCV module is either mangling it because of the data format, 
or that the status report is sent in by the bb-mysqlstat.sh script is on 
a single line (instead of using newline characters after each value). 
I've search the mailing list archives and no one has mentioned changing 
the script output format.

Only one of the charts, mysqlslow, shows up in the trends column.  If I 
create a URL to look at the mysqlthread chart, Hobbit will display one, 
but it doesn't show up automatically.

My questions:

1. Why isn't Queriespersecondavg being collected, and why is the rest of 
the data in the rrd file seem incorrect?

2. How do I get the chart to show up in the mysql column?

THanks for any help with this.

Tom




More information about the Xymon mailing list