push @exitstatus, "Cannot parse tracefile on $slave";
};
print "$slave last synced $synctime\n" if $params->{'verbose'};
- $status->{$slave}->{'synced'} = $synctime;
+ $status->{$slave}->{'synced'} = $synctime;
}
else {
push @exitstatus, "$slave broken: " . $response->status_line;
my $o_sync = scalar(grep !$seen{$_}++, map{$status->{$_}->{'synced'}} keys(%{$status}));
if ($o_sync > 1) {
$exitcode = $CRITICAL;
- $o_sync -= 1;
my @mirrors = sort { $status->{$a}->{'synced'} <=> $status->{$b}->{'synced'} } keys %{$status};
- push @exitstatus, "$o_sync mirror(s) not in sync (from oldest to newest): ".
- join(",", splice(@mirrors,0,$o_sync));
+ my @not_most_recent = grep { $status->{$_}->{'synced'} <=> $status->{$mirrors[-1]}->{'synced'} } @mirrors;
+ $o_sync = scalar @not_most_recent;
+ push @exitstatus, "$o_sync mirror(s) not in sync (from oldest to newest): ".
+ join(", ", @not_most_recent);
} else {
print "All mirrors unique\n" if $params->{'verbose'};
}
* dsa-check-mirrorsync: Handle case where we cannot parse a tracefile
better (do not reference undefined values, properly exit with UNKNOWN).
+ * dsa-check-mirrorsync: Fix counting of out-of-date mirrors.
- -- Peter Palfrader <weasel@debian.org> Thu, 29 Oct 2009 19:09:36 +0100
+ -- Peter Palfrader <weasel@debian.org> Mon, 02 Nov 2009 15:49:28 +0100
dsa-nagios-checks (83) stable; urgency=low