Today I'm trying to manage to configure nagios plugin so that, it'll be able to monitor MySQL server, but unfortunately I didn't success.
I've installed Nagios Core v.4.0.8 on CentOS Server x64 v.6.6. I have already configured a lot of different services on other servers and also on this particular server as well, but I've got stucked on MySQL. The Server is also CentOS based, it runs Asterisk server on FreePBX v.12.0.74, so as it uses MySQL for storing data, I want to monitor its health. I've installed plugin check_mysql_health on my nagios server, opened connection, granted access and than tested by running the following command from Nagios server:
Code: Select all
/usr/local/nagios/libexec/check_mysql_health --hostname xxx.xxx.xxx.xxx --username username --password 'password' --database asterisk --mode 'threads-connected'
Code: Select all
OK - 2 client connection threads | threads_connected=2;10;20
First I added the following record into commands.cfg:
Code: Select all
# 'check_mysql_health' command definition
define command{
command_name check_mysql_health
command_line $USER1$/check_mysql_health --hostname $HOSTADDRESS$ --username $ARG1$ --password $ARG2$ --database $ARG3 --mode $ARG4$
}
Code: Select all
# Asterisk MySQL Database monitoring
define service {
use generic-service
host_name asterisk
service_description Asterisk MySQL Database
check_command check_mysql_health!username!'password'!asterisk!threads-connected
contact_groups admins
}
I have already tried different kind of modes, but all the same. the only thing I'm in doubt is that my current password for MySQL user is very strong and contains special characters (! letter as well), that why I tried to escape it with quotes, maybe that is the problem? But in that case, why I'm getting green status I don't know, please help, as I've lost entire working day on this issue.
Thanks in advance.