Page 1 of 3

Problem with check_http for https site

Posted: Tue Oct 20, 2015 6:18 am
by neworderfac33
Good afternoon,

I am trying to monitor an https site from the Linux prompt as follows, to make sure that it works before I make changes to my windows.cfg:

Code: Select all

/usr/local/nagios/libexec/check_http -H MYSERVERID -u https://my/web/address -p 443
but it's returning "CRITICAL - Socket timeout after 10 seconds"

I've tried various permutations of "-S" and "-p 443", but nothing gets me "through"!

I ran "nmap MYSERVERID -p- 443" which returned:

Code: Select all

Starting Nmap 5.51 ( http://nmap.org ) at 2015-10-20 12:15 BST
Nmap scan report for MYSERVERID (99.99.99.99)
Host is up (0.00024s latency).
rDNS record for 99.99.99.99: NYSERVERID
PORT    STATE SERVICE
443/tcp open  https
which looks positive. I also ran:

Code: Select all

which openssl
which returned:

Code: Select all

/usr/bin/openssl
and

Code: Select all

/usr/local/nagios/libexec/check_http -H MYSERVERID -u https://my/web/address -S
which returned:

Code: Select all

check_http: Invalid option - SSL is not available
Finally, I've Googled the subject and seen someone having to recompile/reinstall the plugins with:

Code: Select all

./configure --with-openssl=/usr/bin/openssl
is there any way in which i can tell if I need to do this, or can anyone give me pointers as to how to correctly monitor https sites?

As always, thanks in advance.

Pete

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 9:18 am
by rkennedy
./configure --with-openssl=/usr/bin/openssl is indeed the right command, you will need to recompile with SSL.

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 9:27 am
by neworderfac33
Thanks for coming back to me. Is it really as simple as just typing that command in?

Which folder to I need to be in when I run it?

And do i need to back up any of my config files before I do so?

Regards

Pete

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 9:36 am
by eloyd
You do this in whatever directory that you originally compiled Nagios. Typically, /tmp/nagios<something>.

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 9:38 am
by rkennedy
Yes, you will need to run these 3 commands.

Code: Select all

./configure --with-openssl=/usr/bin/openssl
make
make install
The directory to run it in is /tmp/nagios-plugins-2.1.1/ (this could vary, but it's where you extracted the nagios-plugins-2.1.1.tar.gz to).

No, this will only affect your plugins.

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 10:00 am
by neworderfac33
Ah. I didn't install Nagios, I've only carried out the configuration and the guy who did is off sick.

There'es nothing in the /tmp folder that looks anything like what you've described.

I'd best wait for him to come in tomorrow (hopefully!)

At least I know that I need to do now, but please don't close this thread just yet just in case..!

Thank you.

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 10:10 am
by rkennedy
Sounds good. Let us know tomorrow if you need more assistance.

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 10:16 am
by neworderfac33
I don't suppose there's any way of finding the folder to where the plugins were extracted, is there?

I can see all the plugins (including check_http) in /usr/local/nagios/libexec/, but if I try to run the command from there, I get:

Code: Select all

[root@MYHOSTSERVER libexec]# ./configure--with-openssl=/usr/bin/openssl
bash: ./configure--with-openssl=/usr/bin/openssl: No such file or directory
Yet if I go into /usr/bin/, I can clearly see openssl listed there.

To quote Monty Python, "My Brain Hurts!".

Pete

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 10:20 am
by neworderfac33
Just as a matter of interest, is there any way to make Linux display the full current path at the command prompt, instead of just the current foldername?

Re: Problem with check_http for https site

Posted: Tue Oct 20, 2015 10:21 am
by eloyd
You can always download the plugins again as follows:

Code: Select all

cd /tmp
wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
tar xfz nagios-plugins-2.1.1.tar.gz
cd nagios-plugins-2.1.1
./configure--with-openssl=/usr/bin/openssl
make
make install