【问题标题】:Check_MK - configuring legacy checkCheck_MK - 配置遗留检查
【发布时间】:2016-01-29 15:22:37
【问题描述】:

根据官方网站,我在 Ubuntu 14.04.3 LTS 机器上运行 OMD 1.20 -latest,Check_MK 1.2.4p5 社区版。

我需要配置一个 FTP 检查,该检查还将检查凭据和读/写文件。据我所知,标准插件不提供这样的功能,所以我尝试使用自定义插件,特别是:https://exchange.nagios.org/directory/Plugins/Network-Protocols/FTP/check_ftp_rw/details

所以监控服务器应该测试没有安装代理的外部 FTP 服务器。 我在 /usr/lib/nagios/plugins 中有插件,并手动运行它,它工作正常。

现在我正在尝试将其配置为 check_mk 中的检查,因此我执行了以下操作 在 /opt/omd/sites/monitoring/etc/check_mk/main.mk

# Put your host names here
# all_hosts = [ 'localhost' ]
all_hosts = [ ]

extra_nagios_conf += r"""

define command {

    command_name    check_ftprw
    command_line    /usr/lib/nagios/plugins/check_ftp_rw --host ftp.test.com --user test --password 'test123' --dir pub

}

"""
legacy_checks = [

  ( ( "check_ftprw", FTP", True), [ "localhost"] ),

]

我重新启动 omd 站点并检查库存,但它从不接受此检查。

【问题讨论】:

  • 1) 根据docslegacy_checks 已弃用,您应该改用custom_checks。 2)您缺少引号:( "check_ftprw", FTP", True) 应该是( "check_ftprw", "FTP", True)。 3)您确定将all_hosts留空会起作用吗? 4) 重启后检查check_mk日志是否有错误?
  • 我已经更正了丢失的报价,但它是一样的。如果我将 localhost 放在 all_hosts 中,则库存插件会给出关于重复主机的错误,在 syslog 中我看不到与 check_mk 相关的任何内容

标签: linux perl monitoring nagios check-mk


【解决方案1】:

我已经解决了这个问题,配置没问题,那么我们需要重新加载check_mk:cmk -O

然后我们需要检查该命令是否注册在check_mk_objects.cfg中:

# extra_nagios_conf



define command {

    command_name    check_ftprw
    command_line    /usr/lib/nagios/plugins/check_ftp_rw --host ftp.xxx --user test --password 'test' --dir pub --file test.txt --write

}

我们可以使用:check_mk_agent 检查代理输出

【讨论】:

    猜你喜欢
    • 2021-02-21
    • 1970-01-01
    • 1970-01-01
    • 2020-02-17
    • 1970-01-01
    • 1970-01-01
    • 2012-05-02
    • 1970-01-01
    相关资源
    最近更新 更多