我在2台服务器上有一个mysql master master复制,并且工作正常。现在,我需要使用nagios插件对其进行监视。我从nagios网站下载了check_replication.sh
,并将其作为插件添加到代理服务器中。当我在本地运行check_replication.sh
时,表明复制很好。但是,当我从nagios服务器运行相同的命令时,它显示为失败。
/usr/local/nagios/libexec/check_nrpe -H remoteserver -c check_repl
我还将用户nagios添加到了sudoers中以运行mysql命令。知道可能是什么问题吗?
使用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
}