Page 1 of 2
zmaudit not clearing up after zmfilter deletes events 1.21.1
Posted: Tue Jun 21, 2005 10:59 am
by lazyleopard
Is there a known problem with zmaudit not clearing away event directories after zmfilter has deleted events in 1.21.1 (or perhaps even 1.21.0)? Reason I ask is that I've noticed zmaudit reporting it's cleaning up a few events which have been deleted from the database, but that the actual file system contains large numbers of event directories which don't belong to events that still exist in the database. Yet zmfilter is reporting that it's deleting events.
At present, the database says one of my cameras has 965 active and 27 archived events, but the directory for that camera contains 3314 event directories, many (a great many more than 27) of which are older than the oldest recorded non-archived event, but zmaudit doesn't seem to be interested in clearing them away.
It's not as if zmaudit isn't running, though.
Code: Select all
-rw-r--r-- 1 apache apache 65 Jun 19 03:15 zmtrigger.log
-rw-r--r-- 1 apache apache 895 Jun 19 03:15 zmpkg.log
-rw-r--r-- 1 apache apache 71 Jun 19 03:15 zmwatch.log
-rw-r--r-- 1 apache apache 1473 Jun 20 11:03 zmdc.log
-rw-r--r-- 1 apache apache 159572 Jun 21 11:46 zmaudit.log
-rw-r--r-- 1 apache apache 133663 Jun 21 11:58 zmfilter.log
Posted: Tue Jun 21, 2005 10:20 pm
by zoneminder
Are the remaining directories empty, or do they still have contents?
Phil
Posted: Tue Jun 21, 2005 10:54 pm
by lazyleopard
Very definitely full. I spotted the problem when the PurgeWhenFull filter failed to live up to its name even though it was deleting events from the database.
Posted: Tue Jun 21, 2005 11:02 pm
by lazyleopard
Weird thing, as you might be able to see from the log snippets in
http://www.zoneminder.com/forums/viewtopic.php?t=3547, is that zmaudit is deleting a few events, but it never seems to catch up with the event entries zmfilter deletes, even when zmfilter gets to a point where it's no longer deleting things. (I did have to cheat and go and delete some data to get the filesystem under the magic x% that triggered PurgeWhenFull...)
Posted: Wed Jun 22, 2005 10:28 am
by zoneminder
Can your restart zmaudit and post the first 50 or so lines from the log file, or more if they are useful. I know you posted some of this on the other thread but I don't think it was from the top of the log file.
Phil
Posted: Wed Jun 22, 2005 11:52 am
by lazyleopard
Hmmm... They don't look very helpful... Probably need a higher debug level?
zmfilter.log just says this:
and zmaudit.log says this:
Code: Select all
Found database monitor '5', got 518 events
Found database monitor '6', got 985 events
Found database monitor '7', got 237 events
Found database monitor '8', got 3 events
Found database monitor '9', got 338 events
Found database monitor '10', got 0 events
Found filesystem monitor '10', got 0 events
Found filesystem monitor '5', got 2501 events
Found filesystem monitor '6', got 3289 events
Found filesystem monitor '7', got 472 events
Found filesystem monitor '8', got 3 events
Found filesystem monitor '9', got 884 events
Deleting 2 old images
Posted: Wed Jun 22, 2005 11:58 am
by lazyleopard
...though the zmaudit log does show the discrepancies in event counts.
Posted: Wed Jun 22, 2005 12:53 pm
by zoneminder
Can you confirm this is 1.21.1?
Phil
Posted: Wed Jun 22, 2005 1:30 pm
by lazyleopard
Yep. 1.21.1.
I've been peering at zmaudit.pl to try to figure out why it finds those differences and then does nothing about them. No blinding revelations so far...
Posted: Wed Jun 22, 2005 3:30 pm
by zoneminder
Can you try editing zmaudit.pl (you might as well try this directly on the installed one). Find the line
and change
Light blue touch paper and retire. Check the log and make sure it's not wiping out everything but only those events it's supposed to.
Phil
Posted: Wed Jun 22, 2005 3:45 pm
by zoneminder
Actually, probably best not to do that just yet. I've tried it here and I don't think it's quite right.
Phil
Posted: Wed Jun 22, 2005 3:51 pm
by lazyleopard
Ok...
Posted: Wed Jun 22, 2005 4:07 pm
by zoneminder
Ok, take 2, after wiping out a bunch of real events!
In zmaudit.pl find the line just below the one in the prevous post (about line 236 I think) that looks like
Code: Select all
if ( !$db_events->{$fs_event} && (!$age || ($age > MIN_AGE)) )
and change it to
Code: Select all
f ( !$db_events->{$fs_event} && ($age < 0 || ($age > MIN_AGE)) )
Then restart zmaudit.pl. Don't apply the previous change, just this one. You might want to stop ZM altogether and run zmaudit from the command line as
zmaudit.pl
for interactive mode (soon to be deprecated) or
zmaudit.pl -r
to get it just to tell you what it would do without actually doing anything.
Phil
Posted: Wed Jun 22, 2005 5:44 pm
by lazyleopard
That would appear to want to delete the correct number of events...
5098 of them!
Thanks.
Posted: Thu Jun 23, 2005 1:14 am
by cordel
That has helped out my issue as well
Thanks Phil
Regards,
Cordel