https cert check

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
Shivaramakrishnan
Posts: 71
Joined: Tue May 15, 2012 10:11 pm

https cert check

Post by Shivaramakrishnan »

Hi
I have a question regarding the http and https check along with cert expiry.I wanted to be get notice when the port 80/443 goes down or cert expired for xyz.com
I used the check_http plugin to obtain the result

On nagios server i defined:
define service {
use generic-service
hosts abc
service_description HTTP Server Check
check_command check_http
}

define service {
use generic-service
host_name abc
service_description HTTPS Check
check_command check_nrpe_1arg!check_cert
}


on remote server (abc) where i need to check the port 80 and 443:
nrpe_local file:
command [check_cert]=/usr/lib/nagios/plugins/check_http --ssl -I xyz.com -C 30



Ouptuts from Nagios GUI:
HTTP Server Check
OK 07-25-2012 16:38:48 0d 2h 39m 54s 1/3 HTTP OK - HTTP/1.1 302 Found - 0.001 second response time

HTTPS Check
OK 07-25-2012 16:39:49 0d 0h 23m 47s 1/3 OK - Certificate will expire on 09/22/2013 15:01.

Questions:
1.
Will my current service description for http check the port 80 on abc and report when down ?
2.
Will my current service description for https check the port 443 on abc and report when down and also give the cert expiry for xyz.com ?
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: https cert check

Post by agriffin »

Yes, I believe your understanding is accurate and that your service checks will do what you want.
Shivaramakrishnan
Posts: 71
Joined: Tue May 15, 2012 10:11 pm

Re: https cert check

Post by Shivaramakrishnan »

I was not sure of the fact that whether I need to use check_nrpe to check the http port on the remote server,Something like the one defined below.(I have defined as just check_http)
Can you please confirm on this?
Also I wanted to know if the status would change to critical if the https port is down even though the cert would be valid?
"OK 07-25-2012 16:39:49 0d 0h 23m 47s 1/3 OK - Certificate will expire on 09/22/2013 15:01. "

define service {
use generic-service
hosts abc
service_description HTTP Server Check
check_command check_nrpe_1arg!check_http
}
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: https cert check

Post by agriffin »

NRPE is not required here, but it will work. Also, if the port is down the service should show critical even if the certificate is valid.
Locked