I posted some code to the MySQL Forge at:
http://forge.mysql.com/snippets/view.php?id=52
Basically I gather some stats on my webservers in a very crude way. It runs a bunch of commands on the commandline (I run it every 5 minutes from a cron script). Please note that it adds to the load of the database server by running these commands, and it connects a few times to the database, so it actually increases things like “total # of connections” by the sheer fact that it runs.
This should run on most Unix machines, running most versions of MySQL. Please comment to this entry if you find something wrong or an incompatibility.
An explanation of the code follows:
This script will produce a string that looks like this:
(’value’,'value’,'value’,123,’value’),
and all you have to do is add a line at the …