trend graphs for mysql

Help
2006-09-14
2013-04-26
  • Hello

    I suppose it is possible to graph trends for mysql, but so far I was not able to get something.

    I copied/pasted/modified informations found in http://www.hswn.dk/hobbiton/2006/05/msg00528.html without success

    I added "MySQLPerf=ncv" to TEST2RRD, "MySQLPerf:mysqlslow,MySQLPerf:mysqlthread" to GRAPHS and NCV_MySQLPerf="Queriespersecondavg:GAUGE"

    Now I have a line saying "hobbit graph ncv:MySQLPerf" at the end of the page, but no more.

    Any idea?

    Cheers,
    Gildas (gn1 sanger.ac.uk)

     
    • There are some problems there, some related to hobbit, some to the script that is a bit different from the mysql-monitor.
      First you've to modify the dbcheck.pl script because hobbit is getting wrong data from it:
      change line 112 from

      my $status_message=sprintf("\nMySQL Connection statistics\n\nThreads\t\t= %s\nQuestions\t= %s\nSlow queries\t= %s\nOpens\t\t= %s\nFlush tables\t= %s\nOpen tables\t= %s\nQueries per second avg\t= %s\n",$thr,$quest,$slquery,$open,$flush,$optabl,$query);

      to

      my $status_message=sprintf("\nThreads\t\t= %s\nQuestions\t= %s\nSlow queries\t= %s\nOpens\t\t= %s\nFlush tables\t= %s\nOpen tables\t= %s\nQueries per second avg\t= %s\n",$thr,$quest,$slquery,$open,$flush,$optabl,$query);

      Then put the full NCV definition
      NCV_mysqlperf="Threads:GAUGE,Questions:DERIVE,Slowqueries:GAUGE,Opens:GAUGE,Flushtables:GAUGE,Opentables:GAUGE,Queriespersecondavg:GAUGE,*:NONE"

      You also need to modify or the column name in the dbcheck.ini and call it mysql or change in the hobbitgraph.cfg the [mysqlxxxx] definition because the rrd file name will be columnname.rrd so if the test is called mysqlperf you've to modify it in the hobbitgraph.cfg

      If you want to show one of the graphs in the mysqlperf column you need to rename the graph name in the hobbitgraph.cfg file to mysqlperf (or mysql) or it will not be shown there.
      To view the graph on the trends column you have to add it to your bb-hosts:
      0.0.0.0 mysqlserver # dbcheck TRENDS:*,mysqlperf:mysqlslow|mysqlthread 

      This will show the 2 graphs in the trends column...

      You can also add other graphs in the same way you just need to create the definitions for them in the hobbitgraph.cfg

      Let me know if this works or you need more help ...

       
    • Sorry the exact line for NCV is:
      NCV_mysqlperf="*:NONE,Threads:GAUGE,Questions:DERIVE,Slowqueries:GAUGE,Opens:GAUGE,Flushtables:GAUGE,Opentables:GAUGE,Queriespersecondavg:GAUGE"

      the other seems to not work.