- push @exitstatus, "$o_sync mirror(s) not in sync (from oldest to newest): ".
- join(", ", @not_most_recent);
+
+ my $newest = time - $status->{$mirrors[-1]}->{'synced'};
+ my $oldest = time - $status->{$mirrors[0]}->{'synced'};
+ my $skew_ok = ( defined $params->{'skew-new'} &&
+ defined $params->{'skew-old'} &&
+ $newest <= $params->{'skew-new'} &&
+ $oldest <= $params->{'skew-old'});
+
+ my $msg;
+ if ($skew_ok) {
+ $exitcode = $OK;
+ $msg = "$o_sync mirror(s) not in sync (from oldest to newest), but still within acceptable skew: ";
+ } else {
+ $exitcode = $CRITICAL;
+ $msg = "$o_sync mirror(s) not in sync (from oldest to newest): ";
+ };
+ push @exitstatus, $msg . join(", ", @not_most_recent);