# HG changeset patch # User heiko # Date 1421422933 -3600 # Node ID 8fdd1e3a6bc32943021389665d52c5e165356903 # Parent a4e11829f96ee82c030ad30a913d4356e04eaf91 Better message if there is no ns server known in public, but the domain diff -r a4e11829f96e -r 8fdd1e3a6bc3 lib/Nagios/Check/DNS/delegation.pm --- a/lib/Nagios/Check/DNS/delegation.pm Thu Jan 08 00:04:06 2015 +0100 +++ b/lib/Nagios/Check/DNS/delegation.pm Fri Jan 16 16:42:13 2015 +0100 @@ -127,20 +127,22 @@ my (@errs, @ns); my @our = eval { sort +ns($domain, nameservers => [$reference], aa => 1, override => $override) }; - push @errs, $@ if $@; + if (chomp $@) { + push @errs, $@; + push @our, $@; + } my @their = eval { sort +ns($domain) }; - push @errs, $@ if $@; - - if (@errs) { - chomp @errs; - die join(', ' => @errs) . "\n"; + if (chomp $@) { + push @errs, $@; + push @their, $@; } - - if ("@our" ne "@their") { + + if (@errs or "@our" ne "@their") { local $" = ', '; - die sprintf "NS differ (%s @our) vs (public @their)\n", + die sprintf "NS differ (%s: @our) vs (public: @their)\n", $override->{$domain} ? 'override' : 'our'; + } @ns = uniq sort @our, @their;