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=5This 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.
--hostor-Hstring value which specifies the URL to check. Example of valid values are: https://www.example.com, example.com or www.example.com/index.html.--portor-Pint value which specifies the TCP port to use. Default value: 443.--warnor-wint value which specifies the limit of days to issue a normal warning. Default value: 15 days.--critor-cint value which specifies the limit of days to issue a critical warning. Default value: 7 days.--helpor-hshows the help.--versionor-vshows the version of the program.
$ git clone https://github.com/rgglez/nagios-check-ssl-expiration.git
$ cd nagios-check-ssl-expirationTo build the program, run:
$ make buildThe executable will be created inside the dist directory.
To install the binary to the default path (/usr/local/nagios/libexec), execute:
# make installOr just copy the executable to your regular Nagios plugins directory.
Copyright 2024 Rodolfo González González.