linux - 如何在nagios中配置https_check URL

标签 linux url https nagios nagiosxi

我已经在 Linux 服务器上安装了 Nagios(Nagios® Core™ 版本 4.2.2)。我已经使用 check_http 为 HTTPS url 编写了一个 JIRA URL 检查。

它应该得到响应 200,但它给出响应 HTTP CODE 302。

[demuc1dv48:/pkg/vdcrz/Nagios/libexec][orarz]# ./check_http -I xx.xx.xx  -u https://xxx.xxx.xxx.com/secure/Dashboard.jspa -S CONNECT
SSL Version: TLSv1
HTTP OK: HTTP/1.1 302 Found - 296 bytes in 0.134 second response time |time=0.134254s;;;0.000000 size=296B;;;

所以我在nagios的配置文件里也是这样配置的

define command{
        command_name    check_https_jira_prod
        command_line    $USER1$/check_http -I xxx.xxx.xxx.com  -u https://xxx.xxx.xxx.com/secure/Dashboard.jspa -S CONNECT -e 'HTTP/1.1 302'
}

现在我的 JIRA 服务器宕机了,但它没有反射(reflect)在 nagios 检查中。nagios 响应仍然只显示 HTTP 代码 302。

如何解决这个问题?

最佳答案

您没有指定,但我假设您在 Nagios 中央服务器中定义了您的命令 commands.cfg配置文件,但你还需要在services.cfg中定义一个服务因为服务使用命令来运行脚本。

如果您正在运行 check_http从不同的服务器检查你还需要在 nrpe.cfg 中定义它配置文件,然后重新启动 nrpe .

附带说明一下,根据您共享的输出,我相信您没有使用 check_http 的标志Nagios 插件支持正确。 来自您的帖子:

check_http -I xxx.xxx.xxx.com  -u https://xxx.xxx.xxx.com/secure/Dashboard.jspa -S CONNECT -e 'HTTP/1.1 302'

来自 ./check_http -h :

-I, --IP-address=ADDRESS
    IP address or name (use numeric address if possible to bypass DNS lookup).

您正在使用主机名 (xxx.xxx.xxx.com)

-S, --ssl=VERSION
    Connect via SSL. Port defaults to 443. VERSION is optional, and prevents auto-negotiation (1 = TLSv1, 2 = SSLv2, 3 = SSLv3).

您指定了 CONNECT

关于linux - 如何在nagios中配置https_check URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48767229/

相关文章:

linux - 我需要 grep 特定行数的数据,例如第 1 行、第 6 行

linux - 多线程程序中的内核模式

ruby-on-rails - FasterCSV:读取远程 CSV 文件

internet-explorer - 有没有办法检查是否启用了 TLS?

linux - Linux下获取屏幕供应商和序列号

c - 系统如何知道没有更多未等待的 child

url - 如何在 opencart 中制作自定义 SEO url?

php - url重写的新手问题

node.js - 使用 Promisify(https) 的 POST 语法

.net - 对 TLS 1.1 和 1.2 的 Windows 紧凑框架支持