Explanation of Alarms, Alerts, and Events

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
Kaboosh
Posts: 8
Joined: Thu Nov 25, 2004 12:35 am

Explanation of Alarms, Alerts, and Events

Post by Kaboosh »

Can somebody explain alarms, alert mode, and events?

So far I've noticed that the system goes to Alarm, then Alert, then Recording, then Idle...I think somebody played a little too much Metal Gear Solid before starting this project :P

Anyways, I'm a little confused as I have set up a camera with a zone but it goes into alert mode whenever there is movement anywhere within it's field of view, not just the zone...yet I can't get it to set off an alarm other than by clicking "force alarm" when viewing it.

Any ideas :?:
Last edited by Kaboosh on Fri Dec 17, 2004 9:50 pm, edited 2 times in total.
"The philosophy of one century is the common-sense of the next" - Henry Ward Beecher
fra&fra
Posts: 12
Joined: Tue Nov 23, 2004 3:41 pm

Post by fra&fra »

I have the same problem and i'm a little in confusion.

I think that is a light changing problem and we have to follow a particular configuration using different zone type that zoneminder supports: but i unable to setting them!!!

Help us :!:
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Idle is when there's nothing, or not enough, happening in the image (as far as ZM is concerned) to cause an alarm.

Recording is when it's recording anyway (you should never see this unless you are in Mocord or Record modes).

Alarm is when something is happening in the frame that will cause (or continue) an event.

Alert is like Idle except it only ever happens after an alarm. If another alarm frame happens when in alert state the event is continued otherwise it drops back to idle after the defined number of frames (post alarm frame count) and the event is closed. It's a sort of hysteresis, though you can turn it off. You cannot get into alert state unless you've been in alarm state.

There's also pre-alarm mode when you specify that you have to have 'x' alarm frames to cause an event.

If your system is going into alarm state then an event has been generated. It will remain in Alert state regardless of what's in the image for the defined number of frames (unless it detects enough movement to cause it to go back to alarm). I don't quite understand when you say your system has gone into Alarm state and then say you can't it to set off an alarm. Can you explain?

Phil,
Rayxen
Posts: 28
Joined: Thu Nov 25, 2004 7:14 am
Contact:

Post by Rayxen »

Ok, I have an interesting situation. Using modetect function, the monitor is idling without any problems, but then it jumps into alert state when there's motion. Now, i presume that it goes into alarm state first, and I'm just not seeing this (I'm yet to confirm this though).

The problem lies in that it stays in alert state 'forever'. I have only tested it for about 30mins, but that's more than long enough to determine that it's not working as it should. I have my post frame buffer set to 10, on a 25fps camera, so it shoudln't be going for 30mins. It's not a refreshing problem, as I manually reload the page and it stills says alert state. The event pops up and has an unknown event with a time (Secs) of 0. If I then change the function of the monitor to anythign else, it goes to idle and the secs are calculated.

It seems the problem is changing back from alert to idle even though the motion has stopped. Any ideas?

Another interesting thing is, that sometimes on longer recordings it miscalculates the duration. It has happened twice now, the current one I tested (30mins) shows: 14485494.04 secs duration, which is obviously incorrect, as it equates to something like 4000 hours. The frames seem to be correct, showing just under 9000 for 30mins. If I click on frames to get a complete frame listing, I get some interesting information - the pre-buffer is clearly working, as it shows 10 frames without motion.... now here's the problem. The rest of the frames are still showing motion.. even when it should have stopped. The wierdest part is the last 4 frames though - and remembering this has happened twice now:

Code: Select all

8984 	Yes 	11:48:36 	1,713.74 	55
8985 	Yes 	11:48:36 	1,713.90 	56
8986 	Yes 	11:48:36 	1,714.05 	57
8987 	Yes 	11:48:37 	1,714.18 	56
8988 	Yes 	10:00:00 	9,999,999.99 	68
8989 	Yes 	10:00:00 	9,999,999.99 	68
8990 	Yes 	10:00:00 	9,999,999.99 	66
8991 	Yes 	10:00:00 	9,999,999.99 	66
You can clearly see that there is a problem with those last four, especially as the time is registering as 10am... the rest of the frames all seem to be correct in regards to time etc, with the exception of the fact that they're all detecting motion with a score of ~50.

------------

Ok, well I have worked out the first issue of the motion continuing for ever. I took a look at the stills again and noticed that it's motion outside int the inclusive zone that is causing it. I have the window as inclusive and the rest of the room as active. I'll have to look into how I can get it stop, when motion in the rest of the room has stopped - I'm with a combination of zones, this is possible.

As for the last four frames, I have a little more info on that too. The last four frames are pitch black, but they still show the motion on certain areas such as the outline of posters on the wall. This is probably related to me having to manually change the function while it's in an alert state - although technically, shouldn't it be in alarm state if there is still motion?

I have one final problem, the email sending and FTP uploading aren't working. Once again this could be related to the same issue. The event is generated, the filters match the event (I run them manually afterwards), they're saved and checked, the options are set to send email and upload. So that's not the problem. I think it must be related to me manually forcing the function change. I'll set the inclusive zone to inactive and see if that fixes that problem.

I shall keep you updated, but if you have any ideas, that'd be great - the last four frame issue is still very odd, esp. with the time changing to 10:00.
Rayxen
Posts: 28
Joined: Thu Nov 25, 2004 7:14 am
Contact:

Post by Rayxen »

Ok, good news and bad news. I changed the zone to exclusive, so now it was monitoring everything except for the window. Running as modect function and the motion detection worked, it recorded for the 30secs and when I left it changed the status to idle. I'm still yet to see the alarm state, but that doesn't concern me, it's clearly working.

I still have the issue of the mail, ftp and program not running. I have created a quick script to see if the problem was just with the mail/ftp configuration and set the following options:

Automatically archive: yes
Automatically upload: yes
Automatically email: yes
Program to run: /home/user/scripts/zmnotify.sh

Running the filter manually produces the desired result of showing the event that just occurred, so the filter is working. The script permissions are as follows:

Code: Select all

[user notification]$ ll /home/user/scripts/zmnotify.sh
-rwxr-xr-x  1 user user 86 Dec  5 10:55 /home/user/scripts/zmnotify.sh
This is the script;

Code: Select all

#!/bin/bash
cur_date=`date +%F-%r`
touch /home/user/zm/notification/en-$cur_date
exit
So it should just create a file in /user/zm/notification/ with the filename of en- and the current date appended. The only problem that it could be, is because the script is running as the apache user it doesn't have the appropriate permissions to create the file in that dir. I'll do a su -c and test that, and also change it to create the file in the tmp folder to confirm.

Checking my FTP logs, there's not even an attempted connection by ZM. I have definately checked, and enabled the options. I did a complete system restart to make sure it was all reloaded. I'm really not sure the cause of this one, but I shall keep investigating.

I also need to work out a zone setup with the window situation too... if anyone has any ideas so I can focus on the other issues, that would be great.
Rayxen
Posts: 28
Joined: Thu Nov 25, 2004 7:14 am
Contact:

Post by Rayxen »

Ok, moving along now ... I still have no idea about why email and FTP isn't working. The script problem is here:

Code: Select all

[/home/user]# su -c '/home/user/scripts/zmnotify.sh' apache
touch: cannot touch `PM': Permission denied
So I'll have to find a quick workaround for that - probably just su inside the script. I'll update when I know what's happening.
User avatar
securiteaze
Posts: 25
Joined: Wed Jun 16, 2004 5:38 pm

Post by securiteaze »

you have a bug in your script the date format you are using returns a string with a space in it.

Code: Select all

prompt$ date +%F-%r
2004-12-05-09:55:02 PM
you could switch to 24 hour time

Code: Select all

prompt$ date +%F-%R
2004-12-05-21:56
or use shell expansion to escape the space

Code: Select all

touch "/home/user/zm/notification/en-$cur_date"
I would probably use the following because I don't like file names with spaces/symbols

Code: Select all

date +%F-%H-%M
Rayxen
Posts: 28
Joined: Thu Nov 25, 2004 7:14 am
Contact:

Post by Rayxen »

Thanks for the tip, the %R will do the trick but I don't think it's going to help the situation. I was only doing that to determine if the script was in fact being executed and it wasn't. Thanks.
User avatar
Kaboosh
Posts: 8
Joined: Thu Nov 25, 2004 12:35 am

Alert vs. Alarm

Post by Kaboosh »

zoneminder wrote: I don't quite understand when you say your system has gone into Alarm state and then say you can't it to set off an alarm. Can you explain?
Sure,

It is set to "Mocord" and always goes into alert even when activity is outside the only zone I have defined, but never goes into alarm - even when an object moves within the zone...I can't quite figure this behaviour out...
Last edited by Kaboosh on Fri Dec 17, 2004 9:50 pm, edited 1 time in total.
User avatar
Kaboosh
Posts: 8
Joined: Thu Nov 25, 2004 12:35 am

Nevermind

Post by Kaboosh »

Nevermind...seems to be running properly (as described by the site admin above) now :D

Does anybody know how I would get rid of problems like (fairly) rapid light-level changes setting off alarms? I've tried setting a maximum blob size but that doesn't seem to cut it...
"The philosophy of one century is the common-sense of the next" - Henry Ward Beecher
User avatar
lazyleopard
Posts: 403
Joined: Tue Mar 02, 2004 6:12 pm
Location: Gloucestershire, UK

Post by lazyleopard »

problems like (fairly) rapid light-level changes
Ah, now that's a tricky one. Try reviewing threads that mention things like sunlight and shadows...
Rick Hewett
Locked