ProgrammersOfVilnius / pov-check-health

Debian package that runs basic system health monitoring checks hourly from cron
https://launchpad.net/~pov/+archive/ppa
2 stars 0 forks source link

Wishlist: check-ssl-certs #7

Closed mgedmin closed 9 years ago

mgedmin commented 9 years ago

It would be a new script, check-ssl-certs, with a config file in /etc/pov/check-ssl-certs, run daily from cron.

We can probably reuse the same setup as for check-health and check-web-health, i.e. add a new wrapper that uses the same functions.sh has a different name and different config file.

It'd be nice to support generation (grep for SSLCertificateFile in /etc/apache2/).

Prototype checkcert function (one I actually use right now, but not integrated with pov-check-health):

checkcert() {
    local server=$1
    local days=${2:-60}
    local OUTPUT=$(/usr/lib/nagios/plugins/check_http -C $days -H "$server" --sni 2>&1)
    case "$OUTPUT" in
        OK\ *)
            if [ $verbose -ne 0 ]; then
                echo "$server: $OUTPUT"
            fi
            ;;
        *)
            warn "$server: $OUTPUT"
            ;;
    esac
}