mysql - nagios mysql复制插件显示远程服务器的失败状态

标签 mysql database-replication nagios nagiosxi

我在 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

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/

相关文章:

PHP文件连接Mysql在Ubuntu操作系统中显示空白页

mysql - 同步两个 MySQL 表

mysql - 创建 MySQL 复制延迟

hadoop - 如何获得自定义 Nagios 插件以与 NRPE 一起使用?

vim - 如何将以空格作为唯一分隔符的段落表格化

php - 我的 mysql_fetch_array() 循环不输出任何答案。有什么建议么?

mysql - GROUP BY 的条件给了我一些真实结果

php - PHP 中更多的嵌套 while 循环

azure - 如何在 Azure SQL PaaS 中进行复制

linux - Nagios - 连接被拒绝和套接字超时