Nagios check_http尝试使用sni监控多个服务器

时间:2014-07-16 21:01:51

标签: nagios sni

我定义了以下服务:

define service{
    use                 remote-service         ; Name of service template to use
    host_name               linode2
    service_description     HTTP-Cert-website1
    check_command           check_http! -H www.website1.com  -C 30 --sni
#   notifications_enabled       0
    }

define service{
    use                 remote-service         ; Name of service template to use
    host_name               linode2
    service_description     HTTP-Cert-website2
    check_command           check_http! -H www.website2.com  -C 30 --sni
#   notifications_enabled       0
    }

当我从终端窗口运行命令时,一切正常。当我按上面显示的那样运行它时,我收到连接拒绝错误。

我在这台服务器上有多个网站。所有站点都可以从nagios服务器中正确解析。

1 个答案:

答案 0 :(得分:0)

错误在于:

check_command           check_http! -H www.website2.com  -C 30 --sni

应该是:

check_command           check_http!www.website2.com

因为默认定义的命令是:

/path/check_http -H $ARG1$

要将check_http与您尝试使用的选项一起使用,请定义一个新命令:

define command {
    command_name        check_http_myoptions
    command_line        /path/check_http -I $ARG1$ -C $ARG2$ --sni
}

然后修改检查命令行:

check_command           check_http!www.website2.com!30
相关问题