# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1419781481 -3600 # Node ID 676230d2d1ae601b3a5f26c214d8b161de9bb7be intial framework diff -r 000000000000 -r 676230d2d1ae .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Sun Dec 28 16:44:41 2014 +0100 @@ -0,0 +1,6 @@ +syntax:glob +Build +_build +blib +MYMETA.* +*.bak diff -r 000000000000 -r 676230d2d1ae Build.PL --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Build.PL Sun Dec 28 16:44:41 2014 +0100 @@ -0,0 +1,33 @@ +use 5.010; +use strict; +use warnings; +use Module::Build; + +my $builder = Module::Build->new( + dist_name => 'nagios-plugin-dns-serial', + dist_version_from => 'plugins/check_dns-serial', + dist_abstract => 'nagios check for dns serial numbers', + checks_files => { + 'plugins/check_dns-serial' => 'nagios/plugins/ius/check_dns-serial', + }, + license => 'perl', + requires => { + perl => '5.14.2', + 'Net::DNS' => '0.74', + }, +); + +if (not defined $builder->install_path('nagios')) { + my $base = do { + if ($builder->installdirs eq 'vendor') { '/usr/lib' } + elsif (defined $builder->install_base) { $builder->install_base } + else { '/usr/local/lib' } + }; + $builder->install_path(nagios => "$base/nagios"); +} + +$builder->bindoc_dirs([@{ $builder->bindoc_dirs }, 'blib/nagios/plugins/ius']); +$builder->add_build_element('checks'); + +# finally +$builder->create_build_script; diff -r 000000000000 -r 676230d2d1ae MANIFEST --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MANIFEST Sun Dec 28 16:44:41 2014 +0100 @@ -0,0 +1,4 @@ +.hgignore +Build.PL +MANIFEST This list of files +plugins/check_dns-serial diff -r 000000000000 -r 676230d2d1ae MANIFEST.SKIP --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MANIFEST.SKIP Sun Dec 28 16:44:41 2014 +0100 @@ -0,0 +1,74 @@ + +#!start included /home/heiko/perl5/lib/perl5/ExtUtils/MANIFEST.SKIP +# Avoid version control files. +\bRCS\b +\bCVS\b +\bSCCS\b +,v$ +\B\.svn\b +\B\.git\b +\B\.hg\b +\B\.gitignore\b +\b_darcs\b +\B\.cvsignore$ + +# Avoid VMS specific MakeMaker generated files +\bDescrip.MMS$ +\bDESCRIP.MMS$ +\bdescrip.mms$ + +# Avoid Makemaker generated and utility files. +\bMANIFEST\.bak +\bMakefile$ +\bblib/ +\bMakeMaker-\d +\bpm_to_blib\.ts$ +\bpm_to_blib$ +\bblibdirs\.ts$ # 6.18 through 6.25 generated this + +# Avoid Module::Build generated and utility files. +\bBuild$ +\b_build/ +\bBuild.bat$ +\bBuild.COM$ +\bBUILD.COM$ +\bbuild.com$ + +# Avoid temp and backup files. +~$ +\.old$ +\#$ +\b\.# +\.bak$ +\.tmp$ +\.# +\.rej$ + +# Avoid OS-specific files/dirs +# Mac OSX metadata +\B\.DS_Store +# Mac OSX SMB mount metadata files +\B\._ + +# Avoid Devel::Cover and Devel::CoverX::Covered files. +\bcover_db\b +\bcovered\b + +# Avoid MYMETA files +^MYMETA\. +#!end included /home/heiko/perl5/lib/perl5/ExtUtils/MANIFEST.SKIP + +# Avoid configuration metadata file +^MYMETA\. + +# Avoid Module::Build generated and utility files. +\bBuild$ +\bBuild.bat$ +\b_build +\bBuild.COM$ +\bBUILD.COM$ +\bbuild.com$ +^MANIFEST\.SKIP + +# Avoid archives of this distribution +\bnagios-plugin-dns-serial-[\d\.\_]+ diff -r 000000000000 -r 676230d2d1ae plugins/check_dns-serial --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/check_dns-serial Sun Dec 28 16:44:41 2014 +0100 @@ -0,0 +1,20 @@ +#! /usr/bin/perl +use 5.014; +use strict; +use warnings; +use GetOpt:::Long; +use Net::DNS; + +sub get_domains { + return qw(schlittermann.de); +} + +# query the serial from +# - the nameservers known from the ns records +# - from the primary master if this is not one of the +# NS for the zone +# - from a list of additional (hidden) servers +# +# OK - if the serial numbers are in sync +# WARNING - if there is some difference +# CRITICAL - if the serial cannot be found at one of the sources