I need to use check_http nagios plugin to do an SSL check against a url to see it is available, but make sure it must notify me if the certificate is expired. I want to do it in a single command.
./check_http -S -H domain.example.com -u $URL
HTTP OK: HTTP/1.1 200 OK - 13058 bytes in 5.080 second response time |time=5.079734s;;;0.000000 size=13058B;;;0
./check_http --ssl -C 14 -e -H domain.example.com -u $URL
OK - Certificate ‘*.example.com’ will expire on ***************
What I want is to ensure that the url exists and certificate is not expired. 1st scenario will only check the URL where as second one will only check the Certificate expiry, not the URL. Help Please.