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 / 问题 / 996115
Accepted
Canadian Luke
Canadian Luke
Asked: 2019-12-19 16:56:27 +0800 CST2019-12-19 16:56:27 +0800 CST 2019-12-19 16:56:27 +0800 CST

Nagios NRPE 不允许参数

  • 772

我正在尝试使用 Nagios NRPE 插件与我的服务器进行通信。我有一个命令定义/etc/nagios/nrpe_local.cfg来使用它:

command[check_service]=/usr/lib/nagios/plugins/check_service -s $ARG1$

当我在终端中手动运行命令时,它会成功:

# /usr/lib/nagios/plugins/check_service -s bind9
OK: Service bind9 is running!

当我尝试从我的 Nagios 服务器运行它时,它抱怨命令未定义:

# /usr/lib/nagios/plugins/check_nrpe -H 10.32.10.3 -c check_service -a bind9
NRPE: Command 'check_service!bind9' not defined

其他check_nrpe命令有效,所以我认为服务器的 没有问题commands.cfg,但无论如何这里是定义:

define command {
    command_name        check_nrpe
    command_line        /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$
}

检查在服务器上看起来像这样:

define service {
    use                 local-service
    host_name           dc1,dc2
    service_description BIND Service
    check_command       check_nrpe!check_service!bind9
}

在 Web 界面上,它返回CRITICAL:服务未运行!,实际上并非如此。

我怎样才能check_nrpe允许一个额外的论点?我试过 enable dont_blame_nrpe,但这也不允许它去。

编辑- 打开调试并重新运行检查,我在系统日志中得到以下信息:

Dec 19 09:01:56 dc1 nrpe[5586]: CONN_CHECK_PEER: checking if host is allowed: 10.32.10.12 port 33962
Dec 19 09:01:56 dc1 nrpe[5586]: Connection from 10.32.10.12 port 33962
Dec 19 09:01:56 dc1 nrpe[5586]: is_an_allowed_host (AF_INET): is host >10.32.10.12< an allowed host >10.32.10.12<
Dec 19 09:01:56 dc1 nrpe[5586]: is_an_allowed_host (AF_INET): is host >10.32.10.12< an allowed host >10.32.10.12<
Dec 19 09:01:56 dc1 nrpe[5586]: is_an_allowed_host (AF_INET): host is in allowed host list!
Dec 19 09:01:56 dc1 nrpe[5586]: Host address is in allowed_hosts
Dec 19 09:01:56 dc1 nrpe[5586]: Host 10.32.10.12 is asking for command 'check_service' to be run...
Dec 19 09:01:56 dc1 nrpe[5586]: Running command: /usr/lib/nagios/plugins/check_service -s
Dec 19 09:01:56 dc1 nrpe[5587]: WARNING: my_system() seteuid(0): Operation not permitted
Dec 19 09:01:56 dc1 nrpe[5586]: Command completed with return code 2 and output: CRITICAL: Service  is not running!
Dec 19 09:01:56 dc1 nrpe[5586]: Return Code: 2, Output: CRITICAL: Service  is not running!
Dec 19 09:01:56 dc1 nrpe[5586]: Connection from 10.32.10.12 closed.

我已经验证了 Group in/etc/systemd/system/multi-user.target.wants/nagios-nrpe-server.service匹配 in 中的nrpe_group参数/etc/nagios/nrpe.cfg。/etc/group和中存在同一个用户/etc/passwd。

linux
  • 2 2 个回答
  • 1463 Views

2 个回答

  • Voted
  1. fukawi2
    2019-12-19T20:26:46+08:002019-12-19T20:26:46+08:00
    1. 确保在启用后重新启动了 nrpe 守护进程dont_blame_nrpe
    2. debug将nrpe.cfg 中的指令更改为 1 并重新启动守护程序。之后,您应该在日志中获得有用的调试信息。
    • 2
  2. Best Answer
    Canadian Luke
    2019-12-21T15:49:01+08:002019-12-21T15:49:01+08:00

    --enable-command-args问题是在构建包时没有设置 Debian 包nagios-nrpe-server,这是使用dont_blame_nrpe.

    • 2

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

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