long delay in email

Support and queries relating to all previous versions of ZoneMinder
Locked
bhomass
Posts: 103
Joined: Sat Jun 11, 2005 6:54 pm

long delay in email

Post by bhomass »

there is currently quite a delay (up to 1 min) in email notification of events. is this due to polling frequency? can I modify this freq setting? is there is way to make it instantaneous (event driven)?
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

The email is handled by the filters script. I should be fairly fast. Are you using your own mailserver and if so is it scanning for viruses before it sends it to the mailbox? It could also be your that your ISP does the same (scans the mail for viruses and such before posting). How often is your mail client checking for mail?

For a test you might setup a bogus cam and make a message filter for that cam and have it send to your cell phone. You can force an alarm and see how long that takes. When I used my cell phone it was fairly quick, faster than email anyway becuase of the client, virus check, etc..
Regards,
Cordel
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

It can be up to a minute before the email is sent, but then there may be other delays in between of course. Email is not really meant to be instantaneous in design anyway.

Phil
bhomass
Posts: 103
Joined: Sat Jun 11, 2005 6:54 pm

Post by bhomass »

thanks for the suggestions. but for my need, I really like to get an email fast. if this is not configurable, please give a hint where to look in the source code for modifications. I like to make is event driven rather than polling.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

There are probably two approaches you can take. One is to edit zmfilter.pl.z and change CHECK_DELAY to be shorter, though this might tie up your machine with checks and won't make it event driven as such.

The other is to take one of the exsiting scripts like zmtrack or zmx10 which do monitor for alarms in a much lighter fashion and import some of the zmfilter code (that sends the mails) and create your own bespoke more reactive monitor scripts. It's not a major task but not trivial either.

I have been thinking of extended zmtrigger to allow outgoing triggers rather than just incoming ones so it will be easier when that's done.

Phil
bhomass
Posts: 103
Joined: Sat Jun 11, 2005 6:54 pm

Post by bhomass »

I am looking thru the code. please give me a hint where does zma.cpp (or elsewhere) detect and record an event? I like to cut into the code there to trigger send message. this is to replace polling based monitoring used right now.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

If you search for 'Gone into alarm state' in zm_monitor.cpp you should find it. Or you could just put it in the Event constructor. I would be very careful that you don't add anything that will take any length of time as it will have a knock on effect and tend to cause lots of bad things to happen.

Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

lol good luck bhomass, i rememeber i had a look at this code once, I still have nightmares now lol
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

What are you trying to say? :wink:
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

i dont know how you do it mate. Everything is well commented. I understand the commants its the rest i have problems with lol. It is one hell of a program, and impresses me more the more i get to know it.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Locked