Page 1 of 2

check_http warn and critical options

Posted: Tue May 06, 2014 12:55 pm
by juana
Hello,

I would like to configure the following so that at 30 days Nagios can Warn me of SSL Cert experidation and at 15 days or less, it will send me a Critical alert:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_http -H myhost.ext -C 14 -t 30 
The above instead warns me 14 days before SSL Cert expiration. It goes critical once the cert has expired.

Thank you,

Juana

Re: check_http warn and critical options

Posted: Tue May 06, 2014 1:15 pm
by lmiltchev
Try:

Code: Select all

/usr/local/nagios/libexec/check_http -H myhost.ext -C 30,15

Re: check_http warn and critical options

Posted: Tue May 06, 2014 1:53 pm
by juana
It did not like that:

Code: Select all

/usr/local/nagios/libexec/check_http -H myhost.ext -C 30,15 
OUTPUT: check_http: Invalid certificate expiration period - 30,15

Re: check_http warn and critical options

Posted: Tue May 06, 2014 3:15 pm
by slansing
If you are using a valid host, you should see output similar to:

Code: Select all

OK - Certificate 'www.google.com' will expire on Tue 22 Jul 2014 01:00:00 AM CDT.
It almost appears as if you forgot to use the '-C' Try running that check against 'www.google.com'.

Re: check_http warn and critical options

Posted: Tue May 06, 2014 3:36 pm
by juana

Code: Select all

[root@nagios user1]# /usr/local/nagios/libexec/check_http -H www.google.com -C 30,15
check_http: Invalid certificate expiration period - 30,15
Usage:
 check_http -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]
       [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L] [-a auth]
       [-b proxy_auth] [-f <ok|warning|critcal|follow|sticky|stickyport>]
       [-e <expect>] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]
       [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]
       [-A string] [-k string] [-S] [--sni] [-C <age>] [-T <content-type>]
       [-j method]
[root@nagios user1]# 


Re: check_http warn and critical options

Posted: Tue May 06, 2014 3:39 pm
by slansing
There is definitely seems to be something wrong with your check_http plugin, did you compile this one by hand? I would think that it just came down in the standard nagios plugins package with your XI install. Did you edit it at all? Or replace the plugin? It's almost as if it is stripping the 'C'. How about if you just run:

Code: Select all

/usr/local/nagios/libexec/check_http -H www.google.com

Re: check_http warn and critical options

Posted: Tue May 06, 2014 3:43 pm
by juana

Code: Select all

[root@nagios user1]# /usr/local/nagios/libexec/check_http -H www.google.com
HTTP OK: HTTP/1.1 200 OK - 14531 bytes in 0.067 second response time |time=0.066683s;;;0.000000 size=14531B;;;0
[root@nagios user1]# 
There are couple of us that manages the plugins. I believe this is the standard setup.

Re: check_http warn and critical options

Posted: Tue May 06, 2014 3:51 pm
by tmcdonald
What version is this?

Code: Select all

/usr/local/nagios/libexec/check_http --version

Re: check_http warn and critical options

Posted: Tue May 06, 2014 3:52 pm
by juana
check_http v1.4.15-3-g055b (nagios-plugins 1.4.15)

Re: check_http warn and critical options

Posted: Tue May 06, 2014 3:59 pm
by abrist
The version of check_http (and the rest of the plugins in general) that you are running (v1.4.15-3-g055b) is a dirty github version number. There were a number of bugs fixed in the most recent versions (even a few check_http cert issues). You may want to update the plugins: https://nagios-plugins.org/downloads/