【问题标题】:Nagios nrpe command not defined....but it isNagios nrpe 命令未定义....但它是
【发布时间】:2020-06-01 22:58:56
【问题描述】:

我正在使用 nagios 和 npre 来监控 2 个不同的 postgres 数据库。 我在nrpe.cfg 中有一系列有效的命令,但是当我使用这个特定的命令时,它会显示command "check_X_COMMAND not defined"

我在 nrpe 中使用该命令两次,对于我要检查的每个 DB 使用一次:

command[check_postgres_check_lock_db1]=/etc/nagios/check_postgres_locks --dbname=DB1
command[check_postgres_check_lock_db2]=/etc/nagios/check_postgres_locks --dbname=DB2

DB1 是返回那个错误的那个。 我可以从 nrpe 客户端运行命令而没有任何问题。

我的服务和命令定义正确。

我错过了什么?

【问题讨论】:

    标签: postgresql nagios nrpe


    【解决方案1】:

    您应该提供准确的错误代码。哪个命令是未定义的 check_nrpe 或 check_postgres_check_lock_db1?我猜是第一个。

    如果该命令确实适用于 nrpe 客户端(所以 nagios 服务器) /path_to_nagios/libexec/check_nrpe -H server -t 30 -c check_postgres_check_lock_db1

    你必须在/path_to_nagios/etc/objects/commands.cfg中定义check_nrpe

    define command{
            command_name check_nrpe
            command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$
    }
    

    然后你可以在 server.cfg 中使用它

    define service {
            use                             generic-service
            host_name                       server
            service_description             db
            check_command                   check_nrpe!check_postgres_check_lock_db1
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多