Nagios NRPE : Command not defined

标签 nagios nrpe

在我的 nrpe_local.cfg添加了以下命令:

command[check_mycommand]=/usr/lib/nagios/plugins/check_command 30 35

然后重新启动 nrpe 守护进程。

当我使用 nrpe 执行此命令时我收到以下错误:
NRPE: Command 'check_mycommand' not defined

我使用以下命令来执行:
/usr/lib/nagios/plugins/check_nrpe -H hostname -c check_mycommand

我无法得到任何线索。

在我的 nrpe_local.cfg还添加了 10 个命令,它们运行正常。

最佳答案

In my nrpe_local.cfg added following command:> command[check_mycommand]=/usr/lib/nagios/plugins/check_command 30 35



尝试 :
command[check_mycommand]=/usr/lib/nagios/plugins/check_command -w (warningTreshold) -c (criticalTreshold)
/etc/init.d/nagios-nrpe-server restart

并且确实杀死已经运行的 nrpe 的所有其他守护进程。
原因可能是它已经由不同的用户运行,这可能会导致冲突。
例如。 nagios-nrpe-server 在 root 用户和 nagios 用户下运行

还要确保将 Nagios 服务器的 IP 地址添加到/etc/nagios/nrpe.cfg 中的 allowed_hosts :
allowed_hosts=<ip address of nagios server>

否则,您将无法使用 Nagios 的 NRPE 执行外部命令。

关于Nagios NRPE : Command not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13795027/

相关文章:

linux - 授予 nrpe 以 root 身份运行检查的 sudo 权限

linux - 纳吉奥斯十一 : Provide Multiple Arguments to a Command

linux - 使用 check_nrpe 检查 CPU 性能——奇怪的行为

nagios - 如何将 nagios 默认 url 更改为自定义 url?

powershell - 文件不存在时,文件检查脚本不会引发严重标志

vbscript - 使用 NRPE 执行远程脚本

linux - 为什么当我用 Nagios 调用 ps 时,它在我的 Perl 脚本中只返回一行输出?

python - 解析 ICINGA status.dat 文件

vim - 如何在 vim 编辑器中使用 sed 来替换模式?

linux - CHECK_NRPE : Error - Could not complete SSL handshake