我在 2 台服务器上有一个 mysql 主主复制,并且工作正常。现在我需要使用 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
}
关于mysql - nagios mysql复制插件显示远程服务器的失败状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52586476/