14 $SIG{__DIE__ } = sub() {
16 exit $CODE{'UNKNOWN'};
19 if ( -e "/var/lib/misc/thishost/passwd.tdb" ) {
20 $f = "/var/lib/misc/thishost/passwd.tdb";
22 my $hostname = `hostname -f`;
24 $hostname =~ m/^([a-z]+(?:\.[a-z]+)+)$/;
25 die "Weird hostname '$hostname'\n" unless defined $1;
27 if ( -e "/var/lib/misc/$hostname/passwd.tdb" ) {
28 $f = "/var/lib/misc/$hostname/passwd.tdb";
32 die "Could not find passwd.tdb" unless defined $f;
34 my @stat = stat($f) or die ("Cannot stat $f: $!\n");
35 my $age = time - $stat[10];
37 if ($age > 48 * 3600) {
38 $hage = sprintf("%.1f days", $age / 24 / 3600);
39 } elsif ($age > 3600) {
40 $hage = sprintf("%.1f hours", $age / 3600);
42 $hage = sprintf("%d minutes", $age / 60);
46 print "WARNING: ud-ldap info is $hage old\n";
47 exit $CODE{'WARNING'};
49 print "OK: ud-ldap info is $hage old\n";