Showing posts with label Zabbix. Show all posts
Showing posts with label Zabbix. Show all posts

Friday, June 24, 2011

Zabbix monitoring MySQL on a windows Server

In order to monitor MySQL on windows you need a few extra utilities.  I downloaded http://sourceforge.net/projects/unxutils/ and used the cut, wc, and grep utilities out of that.

Then add the following lines to your agentd configuration file:


UserParameter=mysql.queries[*],mysql -u root -ptest -N -e "show global status like 'Com_$1'" -s | cut -f2
UserParameter=mysql.ping,mysqladmin -uroot -ptest ping | grep alive | wc -l | cut -d" " -f 7
UserParameter=mysql.uptime,mysqladmin -uroot -ptest status | cut -d: -f2 | cut  -d " " -f2
UserParameter=mysql.threads,mysqladmin -uroot -ptest status | cut -d: -f3 | cut  -d " " -f2
UserParameter=mysql.questions,mysqladmin -uroot -ptest status | cut -d: -f4 | cut  -d " " -f2
UserParameter=mysql.slowqueries,mysqladmin -uroot -ptest status | cut -d: -f5 | cut  -d " " -f2
UserParameter=mysql.qps,mysqladmin -uroot -ptest status | cut -d: -f9 | cut  -d " " -f2
UserParameter=mysql.version,mysql -V
 Replace test with the root@localhost password for your MySQL box.  Once you have done this you can use the Template_App_MySQL to monitor all of those UserParameters.  I ended up making a clone of that template so that I could change the service from "mysql" to "mysqld.exe" in order to monitor it.