remove | in detail output
[mirror/dsa-nagios.git] / dsa-nagios-checks / checks / dsa-check-zone-rrsig-expiration-many
index cfbacfd..445dded 100755 (executable)
@@ -120,15 +120,17 @@ for my $file (sort {$a cmp $b} (readdir INDIR)) {
        next unless ( -f "$file" );
 
        my $do_dnssec = 1;
+       my $delegated = 1;
        my $initial_refs = undef;
        open(F, '<', $file) or die ("Cannot open $file: $!\n");
        for (<F>) {
                if (/^; wzf:\s*dnssec\s*=\s*0\s*$/) { $do_dnssec = 0; }
+               if (/^; delegated\s*=\s*no\s*$/) { $delegated = 0; }
                if (/^; check-initial-refs\s*=\s*(.*?)\s*$/) { $initial_refs = $1; }
        };
        close F;
 
-       if ($do_dnssec) {
+       if ($do_dnssec && $delegated) {
                die "Duplicate zone $file?\n" if exists $dnsseczones{$file};
                $dnsseczones{$file} = {};
                $dnsseczones{$file}->{'initial_refs'} = $initial_refs if defined $initial_refs;
@@ -177,8 +179,8 @@ while (time - $begin <= $params->{timeout}) {
                else { push @{$count->{'unknown'}}, $zone; };
                delete $threads{$zone};
        }
-       # print STDERR "foo #threads:", (scalar keys %threads), ":", join(",", keys %threads),"\n";
        last if scalar keys %threads == 0;
+       print STDERR (scalar keys %threads), " threads left: ", join(" ", keys %threads), "\n" if $params->{'debug'};
        sleep 1;
 }
 for my $zone (sort {$a cmp $b} keys %threads) {
@@ -210,5 +212,8 @@ for my $state (sort {$state_mapping{$b} <=> $state_mapping{$a}} keys %state_mapp
 };
 printf "unsigned: %d", scalar @{$count->{'unsigned'}};
 print "\n";
-print $_ for (@details);
+for (@details) {
+       s/\|/;/g;
+       print $_;
+}
 exit ((defined $exit) ? $exit : 0);