[Nagiosplug-help] https problem using check_http

Chase Simms Csimm at pubpress.com
Mon Mar 22 15:43:46 CET 2010


Scott,

That sounds right.  It was a long time ago when I set up a host using ssl.  Seeing the --with-openssl jogged my memory.  I forgot I did install ssl and then recompile the nagios-plugins.  Coincidentally, my .bash_history goes back to where I finished everything and had it working.  I don't have the commands I used to get it working.

One other little tip, I found Apache on CentOS was returning a custom 404 page.  That meant that even when tomcat was down, it returned a valid page.  So if you're using a web server as a proxy/load balancer you may want to make sure you get what you expect when the back end is down.

I can't imagine how it's working for other hosts and not this one.  I believe Marc was right about the port.  But even though you can do it without passing the port, I would set up the command as check_https and pass the arguments from the service.  I find that a little easier to maintain.

You will need to tweak it for your stuff, but try something like this:

Command:
define command{
        command_name    check_https
        command_line    /nagios/libexec/check_http -w 5 -c 10 --ssl -I $HOSTADDRESS$  -u $ARG1$ -p $ARG2$
}

Service:
define service {
        service_description             HTTPS-SERVICE-FOR-EACH-PORT
        use                             24X7-SERVICE-WEB-TEAM
        hostgroups                      HTTP-SERVERS
        check_command                   check_https!/index.html!8443 
}


Chase


>>> "Scott, Ewan" <EWScott at scotborders.gov.uk> 3/19/2010 6:52 AM >>>
Marc/Chase

Thanks for the responses.

>From what you say I should be looking to use the --ssl option and revise my syntax.

Strangely however I am using the same syntax for other systems and it works.
eg.
# /usr/local/nagios/libexec/check_http -I 150.150.100.57 -u https://150.150.100.57:6789/index.html 
HTTP OK: HTTP/1.1 200 OK - 3109 bytes in 0.009 second response time |time=0.008959s;;;0.000000 size=3109B;;;0

I had tried  the --ssl option previously and got the "check_http: Invalid option - SSL is not available" error message. Hence I ended up trying the above.

I have the following packages installed:

# dpkg --list | egrep -i 'openssl|libssl-dev'               
ii  libssl-dev                           0.9.8g-16ubuntu3.1                         SSL development libraries, header files and 
ii  openssl                              0.9.8g-16ubuntu3                           Secure Socket Layer (SSL) binary and related
ii  python-openssl                       0.9-1                                      Python wrapper around the OpenSSL library
ii  ssl-cert                             1.0.23ubuntu2                              simple debconf wrapper for OpenSSL
# 


Can you confirm that to get round this problem properly I have to recompile the plugins package as "./configure --with-openssl" and then I should be OK?

Regards
Ewan

-----Original Message-----
From: Marc Powell [mailto:lists at xodus.org] 
Sent: 18 March 2010 17:26
To: Nagios Plugin Help List
Subject: Re: [Nagiosplug-help] https problem using check_http


On Mar 18, 2010, at 10:51 AM, Scott, Ewan wrote:

> Hi
> 
> I'm trying to check a JBoss server by accessing it's home page over https. The link works fine through a browser (https://sbc-hrs-01:8443/index.html ) but not with the nagios check_http plugin.
> 
> /usr/local/nagios/libexec/check_http -I 150.150.100.44 -u https://sbc-hrs-01:8443/index.html 
> HTTP WARNING: HTTP/1.1 404 /index.html - 1182 bytes in 0.007 second response time |time=0.006620s;;;0.000000 size=1182B;;;0
> 
> Any ideas about this from the plugin point of view?

The :8443 in the URL is a port specification. Browsers automagically know how to translate that to the port to connect to but check_http doesn't read -u in that way. Additionally, you need to specify SSL connection, host and proper -u. Try the following --

check_http --help

/usr/local/nagios/libexec/check_http -I 150.150.100.44 --ssl -H sbc-hrs-01 -p 8443 -u /index.html 

--
Marc
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev 
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help 
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

**********************************************************************
This email and any files transmitted with it are privileged, confidential and subject to copyright. Any unauthorised use or disclosure of any part of this email is prohibited. If you are not the intended recipient please inform the sender immediately; you should then delete the email and remove any copies from your system.
The views or opinions expressed in this communication may not necessarily be those of Scottish Borders Council.
Please be advised that Scottish Borders Council's incoming and outgoing email is subject to regular monitoring and any email may require to be disclosed by the Council under the provisions of the Freedom of Information (Scotland) Act 2002.

**********************************************************************


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev 
_______________________________________________
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/nagiosplug-help 
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

The information in this email is intended for the sole use of the addressees and may be confidential and subject to protection under the law. If you are not the intended recipient, you are hereby notified that any distribution or copying of this email is strictly prohibited. If you have received this message in error, please reply and delete your copy.





More information about the Help mailing list