Created
September 15, 2016 10:02
-
-
Save christophlehmann/9df199bebbeb8685578e4fd16adbaf01 to your computer and use it in GitHub Desktop.
Check expiry of SSL certificates used in apache with nagios check_http
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SSL_CERTIFICATE_WARN_DAYS=7 | |
source /etc/(apache2|httpd)/envvars | |
for i in `apache2 -S 2>/dev/null | grep "port 443" | awk '{print $4}' | sort | uniq` | |
do | |
/usr/lib/nagios/plugins/check_http -H $i -C $SSL_CERTIFICATE_WARN_DAYS | xargs echo "$i" | grep -v 'OK -' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment