【问题标题】:nagios-herald Install and confignagios-herald 安装和配置
【发布时间】:2015-04-03 08:14:04
【问题描述】:

我尝试在我的测试虚拟机上安装 nagios-herald。 我尝试将herald 配置为发送电子邮件。当我尝试通过命令发送邮件时,它正在工作,但无法以正确的格式获取/发送。

以下是供您参考的命令。

[root@localhost ~]# /usr/local/nagios-herald/bin/nagios-herald --env-file /usr/local/nagios-herald/test/env_files/nagios_vars.EXAMPLE --formatter=check_ping -r amit@example.com -y nagios@example.com --message-type email -u http://192.168.124.25 --trace

请任何人建议我使用 Nagios 配置 nagios-herald。

【问题讨论】:

    标签: monitoring nagios


    【解决方案1】:

    只是一个快速提示,不要忘记在nagios.cfg 中设置以下内容:

    enable_environment_macros=1
    

    另外,这是我的commands.cfg

    define command {
        command_name    notify-host-by-email
        command_line    /usr/local/nagios-herald/bin/nagios-herald --message-type email -r $CONTACTEMAIL$ --formatter=$_HOSTMESSAGE_FORMATTER_NAME$ --nagios-cgi-url=http://192.168.0.1/nagios/cgi-bin/cmd.cgi --reply-to=nagios@somehost
    }
    
    define command {
        command_name    notify-service-by-email
        command_line    /usr/local/nagios-herald/bin/nagios-herald --message-type email -r $CONTACTEMAIL$ --formatter=$_SERVICEMESSAGE_FORMATTER_NAME$ --nagios-cgi-url=http://192.168.0.1/nagios/cgi-bin/cmd.cgi --reply-to=nagios@somehost
    }
    

    在这之后你应该让它工作。 祝你好运。

    【讨论】:

      【解决方案2】:

      默认项目中没有check_ping 格式化程序。如果您已经编写了一个并且它位于项目目录之外,您可以教nagios-herald 如何使用-F </path/to/custom/formatters> 找到它。

      我还注意到您正在使用--trace 选项。如果您在命令中指定-l <logfile> 或在配置中指定logfile:,您将看到nagios-herald 遇到了什么问题。我打赌你会看到它指出它找不到 check_ping 格式化程序并退回到基本格式化程序。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-02-12
        • 2016-08-24
        • 1970-01-01
        • 2023-03-20
        • 1970-01-01
        • 1970-01-01
        • 2019-12-20
        相关资源
        最近更新 更多