check_http

This forum is intended for the discussion of Nagios plugin development. Feature requests, patches, bug fixes, and all types of development-related discussions are welcome!

NOTE: The SourceForge.net nagiosplug-devel mailing list has been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

check_http

Postby afigles » Wed Sep 11, 2019 12:18 pm

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.
afigles
 
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Postby scottwilkerson » Wed Sep 11, 2019 1:56 pm

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)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http

Postby afigles » Thu Sep 12, 2019 10:12 am

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
afigles
 
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Postby scottwilkerson » Thu Sep 12, 2019 10:22 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http

Postby afigles » Thu Sep 12, 2019 10:36 am

Hello,

Option -S is not available.

check_http: Invalid option - SSL is not available
afigles
 
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Postby scottwilkerson » Thu Sep 12, 2019 11:08 am

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http

Postby afigles » Thu Sep 12, 2019 11:16 am

I installed openssl, how will be the steps after install openssl??
afigles
 
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Postby scottwilkerson » Thu Sep 12, 2019 11:21 am

You would want to follow the guide here
https://support.nagios.com/kb/article.php?id=569
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: check_http

Postby afigles » Thu Sep 12, 2019 11:45 am

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??
afigles
 
Posts: 19
Joined: Wed Sep 11, 2019 12:15 pm

Re: check_http

Postby scottwilkerson » Thu Sep 12, 2019 11:49 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 17032
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Next

Return to Nagios Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests