14 $SIG{__DIE__ } = sub() {
16 exit $CODE{'UNKNOWN'};
21 my @stat = stat($f) or die ("Cannot stat $f: $!\n");
22 my $age = time - $stat[10];
24 if ($age > 48 * 3600) {
25 $hage = sprintf("%.1f days", $age / 24 / 3600);
26 } elsif ($age > 3600) {
27 $hage = sprintf("%.1f hours", $age / 3600);
29 $hage = sprintf("%d minutes", $age / 60);
33 return [$CODE{'WARNING'}, "WARNING: ud-ldap info is $hage old"];
35 return [$CODE{'OK'}, "ud-ldap info is $hage old"];
41 if (-f '/var/lib/misc/thishost/last_update.trace') {
43 push @to_check, '/var/lib/misc/thishost/last_update.trace';
46 push @to_check, qw{/var/lib/misc/thishost/passwd.tdb /var/lib/misc/passwd.db};
51 print "WARNING: $f does not exist.\n";
52 exit $CODE{'WARNING'};
55 my $a = check_age($f);
63 print "OK: ", join(', ', @msg), "\n";