check_tlsa
changeset 5 3ae3e79ee936
parent 4 6b7f69be290a
child 6 10fc0d468fec
equal deleted inserted replaced
4:6b7f69be290a 5:3ae3e79ee936
    16 #openssl s_client -starttls smtp -connect ssl.schlittermann.de:25 | openssl x509  -pubkey | openssl rsa -pubin -inform PEM -outform DER | openssl sha256
    16 #openssl s_client -starttls smtp -connect ssl.schlittermann.de:25 | openssl x509  -pubkey | openssl rsa -pubin -inform PEM -outform DER | openssl sha256
    17 #openssl s_client -starttls smtp -connect ssl.schlittermann.de:25 | openssl x509  -outform DER | openssl sha256
    17 #openssl s_client -starttls smtp -connect ssl.schlittermann.de:25 | openssl x509  -outform DER | openssl sha256
    18 
    18 
    19 use strict;
    19 use strict;
    20 use warnings;
    20 use warnings;
    21 use feature qw(switch);
    21 use feature qw(switch say);
    22 use if $^V >= v5.020 => (experimental => qw(smartmatch));
    22 use if $^V >= v5.020 => (experimental => qw(smartmatch));
    23 use experimental qw(smartmatch);
    23 use experimental qw(smartmatch);
    24 use Monitoring::Plugin;
    24 use Monitoring::Plugin;
    25 use File::Basename;
    25 use File::Basename;
    26 
    26 
    27 #devel
    27 #devel
    28 use Data::Dumper;
    28 use Data::Dumper;
    29 
       
    30 use constant LF => "\n";
       
    31 
    29 
    32 my $VERSION = '0.1';
    30 my $VERSION = '0.1';
    33 my $blurb   = 'This Plugin is intendet to check TLSA Record';
    31 my $blurb   = 'This Plugin is intendet to check TLSA Record';
    34 my $url     = 'https://schlittermann.de';
    32 my $url     = 'https://schlittermann.de';
    35 my $author  = 'Heike Yvonne Pesch';
    33 my $author  = 'Heike Yvonne Pesch';
   107 if (!$domain && !$domainlist) {
   105 if (!$domain && !$domainlist) {
   108     my $script = basename $0;
   106     my $script = basename $0;
   109     my $excuse = "Please set -H <domain> or -f <domainlist>\n"
   107     my $excuse = "Please set -H <domain> or -f <domainlist>\n"
   110       . "For all options try $script --help";
   108       . "For all options try $script --help";
   111 
   109 
   112     print $excuse, LF;
   110     say $excuse;
   113     exit 1;
   111     exit 1;
   114 }
   112 }
   115 
   113 
   116 my $port;
   114 my $port;
   117 my $cert;
   115 my $cert;