Page 1 of 2
check_http
Posted: Wed Sep 11, 2019 12:18 pm
by afigles
I am using nagios core 4.4.1 with nagios-plugins 2.2.1 in Debian 9
I want to use check_http command with SSL (443) but not work, could you help me?? How should I use the command for 443 port??
root@rdxnagios:~/nagios-plugins-release-2.2.1/plugins# /root/nagios-plugins-release-2.2.1/plugins/check_http -H xxxxxxx.domain.es -P 443
CRITICAL - Socket timeout
Port 443 in destination is opened.
Re: check_http
Posted: Wed Sep 11, 2019 1:56 pm
by scottwilkerson
If it's SSL you likely need to change to
Code: Select all
/root/nagios-plugins-release-2.2.1/plugins/check_http -H xxxxxxx.domain.es -S
Also -P is for
Code: Select all
-P, --post=STRING
URL encoded http POST data
port is
Code: Select all
-p, --port=INTEGER
Port number (default: 80)
Re: check_http
Posted: Thu Sep 12, 2019 10:12 am
by afigles
Thanks!
Command works but in nagios.cfg get critical error
command line -> admnagios@rdxnagios:~$ /root/nagios-plugins-release-2.2.1/plugins/check_http -H 172.22.93.35 -P 443 -u
https://xxxxxxxx/sctd/loginPage.do
HTTP OK: HTTP/1.1 200 OK - 63458 bytes in 0.055 second response time |time=0.054795s;;;0.000000 size=63458B;;;0
NAGIOS CONFIG:
commands.cfg
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -H $HOSTADDRESS$ -p $ARG1$ -u $ARG2$
}
webservices.cfg
define service{ ###### SCTD web
use local-service ; Name of service template to use
host_name RGPRDAPP1
# hostgroup_name websites
service_description HTTP_SCTD
check_command check_http!443!
https://xxxxxxxx/sctd/loginPage.do
notifications_enabled 0
}
error in interface web -> CRITICAL - Socket timeout
Re: check_http
Posted: Thu Sep 12, 2019 10:22 am
by scottwilkerson
Change the check_command to add the -S like I suggested, also the -u (URI) should not contain a fill URL, just the URI
Code: Select all
check_command check_http!443 -S!/sctd/loginPage.do
Re: check_http
Posted: Thu Sep 12, 2019 10:36 am
by afigles
Hello,
Option -S is not available.
check_http: Invalid option - SSL is not available
Re: check_http
Posted: Thu Sep 12, 2019 11:08 am
by scottwilkerson
afigles wrote:Hello,
Option -S is not available.
check_http: Invalid option - SSL is not available
Did you compile these plugins on a system without SSL support?
Re: check_http
Posted: Thu Sep 12, 2019 11:16 am
by afigles
I installed openssl, how will be the steps after install openssl??
Re: check_http
Posted: Thu Sep 12, 2019 11:21 am
by scottwilkerson
Re: check_http
Posted: Thu Sep 12, 2019 11:45 am
by afigles
I have compiled again but same problem.
Version OpenSSL -> OpenSSL 1.1.1a 20 Nov 2018
is possible that check_http will have to be compile/configure with other options for SSL??
Re: check_http
Posted: Thu Sep 12, 2019 11:49 am
by scottwilkerson
Did you install all the prerequisites for your OS based on the documentation?
depending on the OS you will need openssl-devel or libssl-dev before running
Code: Select all
cd /tmp/nagios-plugins-release-2.2.1/
sudo ./tools/setup
sudo ./configure
sudo make
sudo make install