my $content = $response->content; # or whatever
my ($date, $foo, $bar) = split("\n", $content);
my $synctime = str2time($date);;
+ if (! defined $synctime) {
+ $synctime = 0;
+ $exitcode = $UNKNOWN;
+ push @exitstatus, "Cannot parse tracefile on $slave";
+ };
print "$slave last synced $synctime\n" if $params->{'verbose'};
$status->{$slave}->{'synced'} = $synctime;
}
}
if ($exitcode == $CRITICAL) {
- print "CRITICAL: " . join(',',@exitstatus) . "\n";
+ print "CRITICAL: " . join(',',@exitstatus) . "\n";
} elsif ($exitcode == $OK) {
print "OK: all mirrors up2date\n";
+} else {
+ print join(',',@exitstatus) . "\n";
}
foreach my $mirror (keys(%{$status})) {
+dsa-nagios-checks (8X) Xtable; urgency=low
+
+ * dsa-check-mirrorsync: Handle case where we cannot parse a tracefile
+ better (do not reference undefined values, properly exit with UNKNOWN).
+
+ -- Peter Palfrader <weasel@debian.org> Thu, 29 Oct 2009 19:09:36 +0100
+
dsa-nagios-checks (83) stable; urgency=low
* Add dsa-check-cert-expire: Checks if a given cert on disk will expire