check_http --ssl still checking 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.
Locked
Rac007
Posts: 3
Joined: Tue Apr 14, 2020 12:42 pm

check_http --ssl still checking HTTP

Post by Rac007 »

Hello everybody,

I'm working to check certificate expiration, I use for that the script check_http.
It's work well, but I noticed that in the same time is checking also HTTP

Exemple:

Code: Select all

./check_http -I 127.0.0.1 -p 8080 --ssl --sni -S -j CONNECT -H  ********** -u https://www.*******.com -C 30,15
Result

Code: Select all

SSL OK - Certificate ' *************** ' will expire on 2022-04-02 08:38 +0200/CEST.HTTP WARNING: HTTP/1.1 400 Bad Request - 376 bytes in 0.114 second response time 
Is there any way to just check only SSL expiration whitout checking HTTP please ?

Thank you for advance.
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: check_http --ssl still checking HTTP

Post by jbrunkow »

That is odd. I believe that the check should only check the certificate when the -C option is used, unless the --continue-after-certificate option is also used.

Code: Select all

     -C, --certificate=INTEGER[,INTEGER]
        Minimum number of days a certificate has to be valid. Port defaults to 443
        (When this option is used the URL is not checked by default. You can use
         --continue-after-certificate to override this behavior)
     --continue-after-certificate
        Allows the HTTP check to continue after performing the certificate check.
        Does nothing unless -C is used.
It could have something to do with one of the other options, or the value you are passing through it. Are you entering an http address for the -H argument? What happens if you just use one option ( either -H or -u ) to specify the address?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Rac007
Posts: 3
Joined: Tue Apr 14, 2020 12:42 pm

Re: check_http --ssl still checking HTTP

Post by Rac007 »

Hi jbrunkow,

First thank you for your replay

To answer your questions :

Are you entering an http address for the -H argument?
===>no, for the -H argument I entered for example google.com

What happens if you just use one option ( either -H or -u ) to specify the address?
==> I used the option -H only but its doesn't work still having the check of the HTTP
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: check_http --ssl still checking HTTP

Post by ssax »

Try this:

Code: Select all

    ./check_http -I 127.0.0.1 -p 8080 --ssl --sni -S -j CONNECT -H  ********** -u www.*******.com -C 30,15
Rac007
Posts: 3
Joined: Tue Apr 14, 2020 12:42 pm

Re: check_http --ssl still checking HTTP

Post by Rac007 »

Hi ssax

I tried your proposition but I still have the check HTPP :(

Code: Select all

SSL OK - Certificate '***********.com' will expire on 2022-04-02 08:38 +0200/CEST. HTTP WARNING: HTTP/1.1 400 Bad Request - 376 bytes in 0.079 second response time 
However, thank you for your help.
Locked