diff -r 9501cc7d9177 -r bd500305861e check_cert.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/check_cert.pl Wed Apr 01 11:19:29 2015 +0200 @@ -0,0 +1,99 @@ +#!/usr/bin/perl + +# Copyright (C) 2015 Matthias Förste +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Matthias Förste + +=encoding utf8 +=cut + +use strict; +use warnings; + +#use Getopt::Long; +use Pod::Usage; + +use Nagios::Plugin; + +package Nagios::Plugin::IUS::Cert; +$VERSION = 2.0; + +my $np = Nagios::Plugin->new( + usage => pod2usage ( -verbose => 0, -exitval => 0) +); + +GetOptions( + "h|help" => sub { pod2usage( -verbose => 0, -exitval => 0 ) }, + "m|man" => sub { + pod2usage( + -verbose => 2, + -exitval => 0, + -noperldoc => ( `perldoc -V 2>/dev/null`, $? != 0 )[-1] + ); + }, +) or pod2usage(); + + +__END__ + +=pod + +=head1 NAME + +check_cert - check ssl certificate expiry + +=head1 SYNOPSIS + +check_cert [options] [directories] + +check_cert -m|--man + -h|--help + +=head1 DESCRIPTION + +This script checks the expiry of openssl certificates. + +=head1 OPTIONS + +=over + +=item B<-b|--binary> I + +Path to the openssl binary (default: /usr/bin/openssl) + +=item B<-w|--warning> I