plugins/check_dns-delegation
changeset 17 07827090c4fc
parent 16 6d401297850b
child 19 3ea8010e4fbc
--- a/plugins/check_dns-delegation	Wed Jan 07 15:56:05 2015 +0100
+++ b/plugins/check_dns-delegation	Wed Jan 07 16:34:53 2015 +0100
@@ -47,6 +47,8 @@
 master/slave zones. The 127.in-addr.arpa, 168.192.in-addr.arpa, and
 0.in-addr.arpa, and 127.in-addr.arpa zones are suppressed.
 
+The B<override> domains are added automatically (See opt B<override>).
+
 =back
 
 =cut
@@ -100,7 +102,8 @@
 }
 
 sub get_domains {
-    my @sources = @_;
+    my %arg = @_;
+    my @sources = @{ $arg{sources} };
     my @domains = ();
 
     foreach my $src (@sources) {
@@ -113,6 +116,7 @@
 
         if ($src =~ m{^local:}) {
             push @domains, get_local_zones;
+            push @domains, @{$arg{local}} if $arg{override};
             next;
         }
 
@@ -235,11 +239,11 @@
       )
       and @argv
       or pod2usage;
-    my @domains = get_domains(@argv);
     my %override = read_override($opt_override) if defined $opt_override;
+    my @domains = get_domains(sources => \@argv, local => [keys %override]);
 
     my (@OK, %CRITICAL);
-    foreach my $domain (shuffle @domains, keys %override) {
+    foreach my $domain (shuffle @domains) {
         print STDERR "$domain " if $opt_progress;
 
         my @ns = eval { ns_ok($domain, $opt_reference, \%override) };