Nagios

Check_webinject 外掛不會使用連接到 https 站點

  • January 30, 2019

我們正在使用 Nagios 來監控我們的一些網站。我們有一個使用舊外掛的腳本,我們正試圖從 cpan 切換到使用 webinject.pl。當腳本執行時,它會生成以下錯誤:

LWP::Protocol::https::Socket: SSL connect attempt failed with unknown error error:1407741A:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert decode error at /usr/local/share/perl5/LWP/Protocol/http.pm line 51.

該網站似乎不支持 TLSv1 for https。如果重要,該站點是 Cisco WebVPN。我在另一個支持 TLSv1 的站點上指出了相同的腳本,它似乎工作正常。

我的網路搜尋是空的。連接成功:

<case
id="1"
description1="Metro Home Page"
description2="Metro, login test"
method="get"
url="https://metro.myco.com/index.php"
verifypositive="restricted"
logrequest="yes"
logresponse="yes"
sleep="1"

/>

連接失敗:

<case
id="2"
description1="WebVPN Home Page"
description2="webvpn.myco.com login test"
method="get"
url="https://webvpn.myco.com/webvpn.html"
verifypositive="Authorized"
logrequest="yes"
logresponse="yes"
sleep="1"

/>

我在這方面做了更多的工作,並且有一個我不喜歡的部分修復。我在程式碼中添加了一行到 sub _get_useragent

$useragent->ssl_opts( SSL_version => 'SSLv3' );

這迫使 SSLv3。這將允許外掛連接到這個站點。我可能會複製該外掛,因此它特定於該站點。但更好的解決方案是在測試案例中添加一個選項。

引用自:https://serverfault.com/questions/402507