Page 1 of 1
long delay in email
Posted: Wed Oct 05, 2005 5:12 am
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)?
Posted: Wed Oct 05, 2005 5:53 am
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
Posted: Wed Oct 05, 2005 7:03 pm
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
Posted: Thu Oct 06, 2005 10:52 pm
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.
Posted: Sun Oct 09, 2005 11:24 am
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
Posted: Wed Dec 14, 2005 2:16 am
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.
Posted: Wed Dec 14, 2005 10:02 am
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
Posted: Wed Dec 14, 2005 10:03 am
by jameswilson
lol good luck bhomass, i rememeber i had a look at this code once, I still have nightmares now lol
Posted: Wed Dec 14, 2005 10:07 am
by zoneminder
What are you trying to say?
Posted: Wed Dec 14, 2005 10:42 am
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.