NAME

Monitoring::Sneck::Checks::cert_file - checks certificate files

VERSION

Version 0.0.1

SYNOPSIS

www_cert_file|perl:cert_file -f /usr/local/etc/ssl/www.pem -k /usr/local/etc/ssl/www.key -n www.example.org
ca_files|perl:cert_file -f /usr/local/etc/ssl/ca.pem -f /usr/local/etc/ssl/intermediate.pem -w 90 -c 30

DESCRIPTION

Checks every certificate in each PEM file, so a chain file has its intermediates checked too. A file that can not be read or has no certificates is CRITICAL, as is a expired one or one not good yet. Then it is WARNING or CRITICAL by the days left.

--key and --name are checked against the first certificate that parses, in the order the files are given. A key that does not match is CRITICAL, as is one that is encrypted, as there is no passphrase to give it. A key readable by everyone is WARNING.

OPTIONS

- -f, --file :: A PEM file. May be given more than once. Required.

- -k, --key :: The PEM private key for the first certificate.

- -n, --name :: A name the first certificate must cover. May be given more than once.

- -w, --warning :: Days left at or under which it is WARNING. Default :: 30

- -c, --critical :: Days left at or under which it is CRITICAL. Default :: 14

METHODS

check

Does the check.

key_status

Checks a private key against a certificate.

- cert :: The Net::SSLeay X509.

- key :: The key file.

Returns the code and what is wrong, undef if nothing.

my ( $code, $problem ) = $check->key_status( $cert, '/usr/local/etc/ssl/www.key' );