nagios mysql replication plugin displays failed state for remote server

161 views Asked by At

I have a mysql master master replication on 2 servers and it is working fine. Now I need to monitor it with nagios plugin. I downloaded the check_replication.sh from the nagios website and added it as a plugin in agent server. when I run the check_replication.sh locally it shows the replication is fine. But when I run the same command from the nagios server it is displayed as failed.

/usr/local/nagios/libexec/check_nrpe -H remoteserver  -c check_repl

I have also added the user nagios to the sudoers to run the mysql command. Any idea what might be the issue?

1

There are 1 answers

0
Asuk Nath On

Use check_mysql_slavestatus.sh

check_mysql_slavestatus.sh

define service{
use             generic-service ; Name of service template to use
host_name       xxxxxxxxxxxxx
check_interval      1           ; Actively check the host every 1 minutes
retry_interval      1           ; Schedule host check retries at 1 minute intervals
service_description     MySQL Replication Delay
check_interval      480
check_command       check_mysql_slavestatus!3306!nagios!nagi0s01!300!600

}