projects
/
mirror
/
dsa-nagios.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://db.debian.org/org/db.debian.org/git/dsa-nagios
[mirror/dsa-nagios.git]
/
dsa-nagios-checks
/
checks
/
dsa-check-dnssec-delegation
diff --git
a/dsa-nagios-checks/checks/dsa-check-dnssec-delegation
b/dsa-nagios-checks/checks/dsa-check-dnssec-delegation
index
82ffcd5
..
5e25363
100755
(executable)
--- a/
dsa-nagios-checks/checks/dsa-check-dnssec-delegation
+++ b/
dsa-nagios-checks/checks/dsa-check-dnssec-delegation
@@
-186,15
+186,16
@@
if (scalar @ARGV) {
$DLV = $params->{'dlv'} if $params->{'dlv'};
$DLV = $params->{'dlv'} if $params->{'dlv'};
-my %data;
-for my $zone (@zones) {
- $data{$zone} = { 'dnskey' => join(', ', get_dnskeytags($zone)),
- 'ds' => join(', ', get_dstags($zone)),
- 'dlv' => join(', ', get_dlvtags($zone)),
- 'parent_dnssec' => get_parent_dnssec_status($zone) };
-}
if ($mode eq 'overview') {
if ($mode eq 'overview') {
+ my %data;
+ for my $zone (@zones) {
+ $data{$zone} = { 'dnskey' => join(', ', get_dnskeytags($zone)),
+ 'ds' => join(', ', get_dstags($zone)),
+ 'dlv' => join(', ', get_dlvtags($zone)),
+ 'parent_dnssec' => get_parent_dnssec_status($zone) };
+ }
+
my $format = "%60s %-10s %-10s %-10s %-10s\n";
printf $format, "zone", "DNSKEY", "DS\@parent", "DLV", "dnssec\@parent";
printf $format, "-"x 60, "-"x 10, "-"x 10, "-"x 10, "-"x 10;
my $format = "%60s %-10s %-10s %-10s %-10s\n";
printf $format, "zone", "DNSKEY", "DS\@parent", "DLV", "dnssec\@parent";
printf $format, "-"x 60, "-"x 10, "-"x 10, "-"x 10, "-"x 10;
@@
-215,15
+216,15
@@
if ($mode eq 'overview') {
my @warn;
my @ok;
my @warn;
my @ok;
- for my $zone (sort {$a cmp $b}
keys %data
) {
+ for my $zone (sort {$a cmp $b}
@zones
) {
my @thiskeys = $key eq 'per-zone' ? what_to_check($zone, $params->{'dir'}) : ($key);
my @thiskeys = $key eq 'per-zone' ? what_to_check($zone, $params->{'dir'}) : ($key);
+ my $dnskey = join(', ', get_dnskeytags($zone)) || '-';
for my $thiskey (@thiskeys) {
for my $thiskey (@thiskeys) {
- my $dnskey = $data{$zone}->{'dnskey'} || '-';
- my $target = $data{$zone}->{$thiskey} || '-';
+ my $target = join(', ', $thiskey eq 'ds' ? get_dstags($zone) : get_dlvtags($zone)) || '-';
if ($dnskey ne $target) {
if ($dnskey ne $target) {
- push @warn, "$zone (
$dnskey != $target
)";
+ push @warn, "$zone (
[$dnskey] != [$target]
)";
} else {
push @ok, "$zone ($dnskey)";
};
} else {
push @ok, "$zone ($dnskey)";
};