add support for new trace file
authorStephen Gran <steve@lobefin.net>
Fri, 9 Mar 2012 20:25:19 +0000 (20:25 +0000)
committerStephen Gran <steve@lobefin.net>
Fri, 9 Mar 2012 20:25:19 +0000 (20:25 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
dsa-nagios-checks/checks/dsa-check-udldap-freshness

index 6022746..9d85424 100755 (executable)
@@ -36,7 +36,17 @@ sub check_age {
 };
 
 my @msg;
-for $f (qw{/var/lib/misc/thishost/passwd.tdb /var/lib/misc/passwd.db}) {
+my @to_check = ();
+
+if (-f '/var/lib/misc/thishost/last_update.trace') {
+       # New style check
+       push @to_check, '/var/lib/misc/thishost/last_update.trace';
+} else {
+       # Old style
+       push @to_check, qw{/var/lib/misc/thishost/passwd.tdb /var/lib/misc/passwd.db};
+}
+
+for $f (@to_check) {
        unless (-e $f) {
                print "WARNING: $f does not exist.\n";
                exit $CODE{'WARNING'};