Page 1 of 1

Filter always matching

Posted: Tue Dec 30, 2008 1:05 am
by billn77
I have 3 cameras and monitors, named Side_door, Sunroom, and LivRoom. I've created 3 filters like below, all running in background.
No matter what monitor raises an alarm, the first filter always matches and does what it should. If I have an alarm in on monitor LivRoom, for example, zmfilter.log shows
12/27/08 19:55:27.979398 zmfilter[4439].DBG [Checking filter 'Side_door_alarm', upload,email,message]
and the resulting email says it was created by the Side_door_alarm filter

Does anyone know why my filters do not seem to be matching properly? I've tried "matching" and "equal to", and I've tried using Monitor ID instead, but the first filter in the list seems to get matched.

Side_door_alarm
Monitor Name matches Side_door
upload, email, message

LivRoom
Monitor Name matches LivRoom
upload, email

Sunroom
Monitor Name matches Sunroom
upload, email

Or, perhaps a simpler question...

Posted: Tue Dec 30, 2008 7:21 pm
by billn77
Is there a way to get more debug info for zmfilter.pl? I tried setting the "extra debug" switch in the options, but I didn't see anything more. I have the option there of choosing which packages give more info, but I don't think zmfilter.pl counts as a package.

Posted: Tue Dec 30, 2008 9:02 pm
by cordel
You can turn the debug level up to 9 and check the enable debug.
You can filter on zmfilter.

Does it return the same results when you click submit from the filter window or does it behave as desired from the filter window?

Posted: Wed Dec 31, 2008 7:16 am
by billn77
Thank you for your reply.

When you say I can filter by zmfilter, do you mean I can put "zmfilter" in the ZM_EXTRA_DEBUG_TARGET field, or do you mean I should filter the output zm_debug.log.XXXXX, like
cat zm_debug.log.XXXXX | grep zmfilter
?
As far as I can tell the zmfilter.log does not get any additional information when I set debug to 9, and the zm_debug_log fills up, but running the above command does not produce anything.

When I perform the Submit, it lists the proper results, only the alarms from the appropriate monitor show up.

To simplify, I deleted the 3 filters I had, and just recreated 1, and it's only an email, no upload. It is always getting matched, no matter which of my 3 monitors I force an alarm on. Here is what zmfilter.log shows. This is with a filter "alarm_Side_door" set to match on Monitor Id equal to 1. I forced an alarm on Monitor Id 3, LivRoom, as you can see in the output.

12/30/2008 22:53:55.282311 zmfilter[4130].DBG [Sleeping for 30 seconds]
12/30/2008 22:54:25.282495 zmfilter[4130].DBG [Checking filter 'alarm_Side_door', email]
12/30/2008 22:54:25.284740 zmfilter[4130].DBG [Checking event 889]
12/30/2008 22:54:25.284847 zmfilter[4130].INF [Creating notification email]
12/30/2008 22:54:25.286463 zmfilter[4130].INF [Sending notification email 'ZoneMinder: Alarm - LivRoom-889 (255 - 255 8)']
12/30/2008 22:54:25.288596 zmfilter[4130].INF [Attaching '3/889/011-capture.jpg]
12/30/2008 22:54:25.693012 zmfilter[4130].INF [Notification email sent]
12/30/2008 22:54:25.694447 zmfilter[4130].DBG [Sleeping for 30 seconds]

and the resulting email says
An alarm has been detected on your installation of the ZoneMinder.
The details are as follows :-
Monitor : LivRoom
Event Id : 891
Length : 1.67
Frames : 25 (5)
Scores : t1275 m255 a255
This alarm was matched by the alarm_Side_door filter and can be viewed at ?view=event&mode=stream&mid=3&eid=891

For more information, here is the segment of zmfilter.log where it reloads the filters (only 1 filter in this case)
12/30/2008 23:03:25.971020 zmfilter[4130].DBG [Reloading filters]
12/30/2008 23:03:25.971482 zmfilter[4130].DBG [Found filter 'alarm_Side_door']
12/30/2008 23:03:25.971600 zmfilter[4130].DBG [SQL:select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId where not isnull(E.EndTime) and ( E.Emailed = 0 ) order by E.StartTime desc]

I have funny feeling that the zmfilter program is maybe not reading the database properly? I'm not strong in mySQL, just a hunch.