plugins/check_dns-serial
changeset 3 9ce7eb4a39c3
parent 2 2d11bbd7be1e
child 4 ebada07bb701
equal deleted inserted replaced
2:2d11bbd7be1e 3:9ce7eb4a39c3
     1 #! /usr/bin/perl
     1 #! /usr/bin/perl
       
     2 # © 2014 Heiko Schlittermann <hs@schlittermann.de>
       
     3 =head1 NAME
       
     4 
       
     5  check_dns-serial - check the dns serial number from multiple sources
       
     6 
       
     7 =head1 SYNOPSIS
       
     8 
       
     9  check_dns-serial [options] DOMAINS
       
    10 
       
    11 =head1 DESCRIPTION
       
    12 
       
    13 B<check_dns-serial> is designed as a Icinga/Nagios plugin to verify that
       
    14 all responsible NS have the same serial number for their zones.
       
    15 
       
    16 Domains we are not responsible for are marked as B<critical>.
       
    17 
       
    18 =cut
       
    19 
     2 use 5.014;
    20 use 5.014;
     3 use strict;
    21 use strict;
     4 use warnings;
    22 use warnings;
     5 use Getopt::Long qw(GetOptionsFromArray);
    23 use Getopt::Long qw(GetOptionsFromArray);
     6 use Net::DNS;
    24 use Net::DNS;
    75     die "NS differ (our @our) vs (their @their)\n";
    93     die "NS differ (our @our) vs (their @their)\n";
    76 }
    94 }
    77 
    95 
    78 sub main {
    96 sub main {
    79     my @argv          = @_;
    97     my @argv          = @_;
    80     my $opt_reference = '212.80.235.130';
    98     my $opt_reference = '127.0.0.1';
    81     my $opt_progress  = -t;
    99     my $opt_progress  = -t;
    82 
   100 
    83     GetOptionsFromArray(
   101     GetOptionsFromArray(
    84         \@argv,
   102         \@argv,
    85 ## Please see file perltidy.ERR
   103 ## Please see file perltidy.ERR
   125 
   143 
   126 exit main @ARGV unless caller;
   144 exit main @ARGV unless caller;
   127 
   145 
   128 __END__
   146 __END__
   129 
   147 
   130 =head1 NAME
       
   131 
       
   132  check_dns-serial - check the dns serial number from multiple sources
       
   133 
       
   134 =head1 SYNOPSIS
       
   135 
       
   136  check_dns-serial [options] DOMAINS
       
   137 
       
   138 =head1 OPTIONS
   148 =head1 OPTIONS
   139 
   149 
   140 =over
   150 =over
   141 
   151 
   142 =item B<--reference>=I<address>
   152 =item B<--reference>=I<address>
   143 
   153 
   144 The address of the reference server for our own domains (default: 212.80.235.130)
   154 The address of the reference server for our own domains (default: 127.0.0.1)
   145 
   155 
   146 =item B<--progress>
   156 =item B<--progress>
   147 
   157 
   148 Tell about the progress. (default: on if input is connected to a terminal)
   158 Tell about the progress. (default: on if input is connected to a terminal)
   149 
   159