Monitor SSL certificate expiration with Nagios

Here is the define Nagios command you need to use to monitor the expiration of your SSL certificates:

define command{
   command_name    check_http
   command_line    /usr/lib/nagios/plugins/check_http --ssl -C 7 -H '$HOSTADDRESS$' -I '$HOSTADDRESS$'

As you can see it is just the default check_http Nagios-plugin with a few arguments.

--ssl tells the plugin that we use SSL

-C is the certificate or check certificate argument followed by the number of days we will get warned before the certificate expires

-H is the hostname/address argument (could also be

-I is the optional IP-address argument

$HOSTADDRESS$ is a "Standard Macro" in Nagios:

Read more about the check_http plugin here: