left header graphic The Network People
Solutions for Hosting Providers
right header graphic

rrdutil faq home : internet : manage : rrdutil : rrdutil faq : monitoring mysql monitor pf firewall

How do I get MySQL statistics into RRDUtil?

In the contrib directory of the RRDutil package is the mysqlstatus.pl script. This script will connect to your mysql server and collect a bunch of statistics. Mysql keeps the counters internally, the status script simply polls them.

Authentication

In order for this to work, the script must be able to connect to the MySQL server. You can try running it and see what it returns. You should get output similar to this:

  • % /usr/local/sbin/mysqlstatus.pl type
  • mysql_select:7046519:mysql_changedb:686107:mysql_update:11897166:mysql_insert:5136329:mysql_delete:28694
  • % /usr/local/sbin/mysqlstatus.pl queries
  • mysql_queriessec:29553348:mysql_connections:1414703:mysql_slowqueries:4

If the script cannot connect to the database server, then your pretty graphs obviously won't work. Authentication is configured exactly the same way as the mysql client program, it checks ~/.my.cnf and uses the username and password information found there. A working example would look something like this:

  • [mysql]
  • user=root
  • pass=secret

Make sure the ~/.my.cnf file is chmod 600 for security.

What do the MySQL graphs looks like?


Last modified on 5/20/05.