AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 697648
Accepted
Ashish Karpe
Ashish Karpe
Asked: 2015-06-10 05:56:41 +0800 CST2015-06-10 05:56:41 +0800 CST 2015-06-10 05:56:41 +0800 CST

check_mysql_slavestatus RPE:无法读取输出

  • 772

我在 Ubuntu 上使用来自 nagios 交换 check_mysql_slavestatus 的 Nrpe 插件。

手动工作:

root@Bastion-01:/usr/local/nagios/libexec# ./check_mysql_slavestatus -H Slave-ip -P 3306 -u root -p xxxxx -w 10 -c 20

OK: Slave SQL running: Yes Slave IO running: Yes / master: 172.31.20.9 / slave is 0 seconds behind master | delay=0s

同样,它适用于 Master DB

root@DB-01:/usr/lib/nagios/plugins# ./check_mysql_slavestatus -H Slave-ip  -P 3306 -u root -p xxxxx -w 10 -c 20

OK: Slave SQL running: Yes Slave IO running: Yes / master: 172.31.20.9 / slave is 0 seconds behind master | delay=0s

出现错误

root@Bastion-01:/usr/local/nagios/libexec# ./check_nrpe -H Master-ip -c check_mysql_slavestatus  
NRPE: Unable to read output

在 Nagios 服务器上

在 Command.cfg 中

define command{
        command_name check_mysql_slavestatus
        command_line $USER1$/check_mysql_slavestatus -H $HOSTADDRESS$ -P $ARG1$ -u $ARG2$ -p $ARG3$ -w $ARG4$ -c $ARG5$
}

vim /usr/local/nagios/etc/objects/nagios_DB1.cfg

define service{
        use                             generic-service 
        host_name                       DB-01
        service_description             check_mysql_slavestatus
     check_command check_nrpe!check_mysql_slavestatus!hostname!portnumber!username!passwd!15!50
}

Nagios 上的输出

check_mysql_slavestatus
CRITICAL    06-09-2015 13:51:51 0d 2h 45m 12s   3/3 (No output on stdout) stderr: execvp(/check_nrpe, ...) failed. errno is 2: No such file or directory 

请让我知道我错在哪里

遵循故障排除文档https://assets.nagios.com/downloads/nagiosxi/docs/NRPE-Troubleshooting-and-Common-Solutions.pdf

vim /etc/sudoers

nagios ALL= NOPASSWD: sudo /usr/lib/nagios/plugins/check_mysql_slavestatus
nagios
  • 1 1 个回答
  • 1725 Views

1 个回答

  • Voted
  1. Best Answer
    Keith
    2015-06-10T11:52:55+08:002015-06-10T11:52:55+08:00

    看起来您并不完全了解 NRPE 的工作原理。您的 Nagios 服务器上没有check_nrpe安装插件,或者它的路径错误。如果没有看到您的 check_nrpe 命令定义,很难确定。

    此外,您似乎对如何将宏传递给 check_nrpe 感到有些困惑......

    check_nrpe!check_mysql_slavestatus!hostname!portnumber!username!passwd!15!50方法:

    ARG1 = check_mysql_slavestatus
    ARG2 = hostname
    ARG3 = port
    ARG4 = user
    ARG5 = pass
    ARG6 = 15
    ARG7 = 50.
    

    这几乎肯定不是您想要/想要的,除非您的 check_nrpe 命令需要 7 个参数(不太可能)。

    将其更改为类似的check_nrpe!check_mysql_slavestatus hostname portnumber username passwd 15 50内容会更正确,但这仅在您将 NRPE 配置为匹配时才有效。它必须接受命令参数,并且您的 check_nrpe 命令定义必须-a $ARG1在最后使用。

    此外,您需要check_mysql_slavestatus在远程端的 NRPE 配置中定义一个使用所有这些参数的命令,而不是在 Nagios 服务器上。

    再次阅读NRPE 文档可能会有所帮助。

    • 2

相关问题

  • 使用 Nagios 监视 Novell 集群服务

  • 异地nagios?[关闭]

  • 是否有任何可用的图形工具来为主机生成 nagios 用户提供的地图坐标?

  • 我如何开始使用 Nagios?

  • 如何为 Exchange 邮件存储配置 Nagios 警报

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve