Problem with check_http for https site

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.
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Problem with check_http for https site

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Problem with check_http for https site

Post by rkennedy »

./configure --with-openssl=/usr/bin/openssl is indeed the right command, you will need to recompile with SSL.
Former Nagios Employee
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Problem with check_http for https site

Post 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
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Problem with check_http for https site

Post by eloyd »

You do this in whatever directory that you originally compiled Nagios. Typically, /tmp/nagios<something>.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Problem with check_http for https site

Post 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.
Former Nagios Employee
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Problem with check_http for https site

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Problem with check_http for https site

Post by rkennedy »

Sounds good. Let us know tomorrow if you need more assistance.
Former Nagios Employee
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Problem with check_http for https site

Post 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
neworderfac33
Posts: 329
Joined: Fri Jul 24, 2015 11:04 am

Re: Problem with check_http for https site

Post 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?
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Problem with check_http for https site

Post 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
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Locked