Skip to content

Latest commit

 

History

History
68 lines (44 loc) · 2.67 KB

README.md

File metadata and controls

68 lines (44 loc) · 2.67 KB

check_ssl_expiration

License GitHub all releases GitHub issues GitHub commit activity Go Report Card GitHub release

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.

Usage

Example

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.

Command line parameters

  • --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.

Build and installation

Dependencies

Get the code

$ git clone https://github.com/rgglez/nagios-check-ssl-expiration.git
$ cd nagios-check-ssl-expiration

Build

To build the program, run:

$ make build

The executable will be created inside the dist directory.

Installation

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.

License

Copyright 2024 Rodolfo González González.

Apache License 2.0. Please read the LICENSE file.