Check MySQL service with nagios.


I was surprised that nagios plugins didn’t come with a pre-packaged check_mysql command! Anyway, here is a quick way to do it.

Add the command definition in command.cfg.

define command{
	command_name check_mysql
	command_line	$USER1$/check_tcp -H $HOSTADDRESS$ -p 3306
}

Add the service definition to an existing host.

define service{
        use     local-service
        host_name       gnucom.cc
        service_description     MYSQL
        check_command   check_mysql
        notifications_enabled   1
}

I’m sure there are better ways to do this, and would really like your feedback if you have a better way. Until then, I’ll just stick with this little port check.

This entry was posted in Nagios, Webhosting and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.