intial framework
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Sun, 28 Dec 2014 16:44:41 +0100
changeset 0 676230d2d1ae
child 1 cff9b7e57f19
intial framework
.hgignore
Build.PL
MANIFEST
MANIFEST.SKIP
plugins/check_dns-serial
--- /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
--- /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;
--- /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
--- /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\.\_]+
--- /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