check_ssl_expiration is a plugin for Nagios written in Go. It retrieves the SSL certificate from the given URL, and compares the notValidAfter field to the warning and critical parameters (if given) to see if the certificate is about to expire. It aims to be fast and simple.
check_ssl_expiration --host=www.example.com --warn=10 --crit=5
This command checks the certificate for www.example.com (if any) and issues a normal warning if the certificate expires within 10 days, and a critical warning if it expires within 5 days.
--host
or-H
specifies the URL to check. Example of valid values are: https://www.example.com, example.com or www.example.com/index.html.--warn
or-w
specifies the limit of days to issue a normal warning. Default value: 15 days.--crit
or-c
specifies the limit of days to issue a critical warning. Default value: 7 days.--help
or-h
shows the help.--version
or-v
shows the version of the program.
$ git clone https://github.com/rgglez/nagios-check-ssl-expiration.git
$ cd nagios-check-ssl-expiration
To build the program, run:
$ make build
The executable will be created inside the dist
directory.
To install the binary to the default path (/usr/local/nagios/libexec
), execute:
# make install
Or just copy the executable to your regular Nagios plugins directory.
Copyright 2024 Rodolfo González González.
Apache License 2.0. Please read the LICENSE file.