check_http

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

check_http

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post 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)
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Post by afigles »

Hello,

Option -S is not available.

check_http: Invalid option - SSL is not available
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post 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?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Post by afigles »

I installed openssl, how will be the steps after install openssl??
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post by scottwilkerson »

You would want to follow the guide here
https://support.nagios.com/kb/article.php?id=569
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
afigles
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Post 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??
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked