Trigger notification as soon as alarm starts

Forum for questions and support relating to the 1.30.x releases only.
Post Reply
Dan12345
Posts: 6
Joined: Fri Sep 02, 2016 7:23 am

Trigger notification as soon as alarm starts

Post by Dan12345 » Sat Sep 03, 2016 12:53 pm

Hi,

I'm trying to trigger a notification as soon as an alarm starts (i.e. immediately, and not once the event has finished).

So I set up a filter running in the background which has "monitor name equal to [name of monitor]". However this only fires when the event is finished. Is there a way I can trigger it immediately?

thanks,

Dan

User avatar
asker
Posts: 1072
Joined: Sun Mar 01, 2015 12:12 pm

Re: Trigger notification as soon as alarm starts

Post by asker » Sat Sep 03, 2016 1:37 pm

Google for zmeventserver
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

Dan12345
Posts: 6
Joined: Fri Sep 02, 2016 7:23 am

Re: Trigger notification as soon as alarm starts

Post by Dan12345 » Sat Sep 03, 2016 1:42 pm

brilliant - thank you!

Dan12345
Posts: 6
Joined: Fri Sep 02, 2016 7:23 am

Re: Trigger notification as soon as alarm starts

Post by Dan12345 » Sat Sep 03, 2016 2:40 pm

On second thoughts - ouch - much too complicated for me. I just want to run a simple script when an alarm is received, and zmeventserver looks like overkill. Using swatch to monitor syslog seems a lot easier...

User avatar
asker
Posts: 1072
Joined: Sun Mar 01, 2015 12:12 pm

Re: Trigger notification as soon as alarm starts

Post by asker » Sat Sep 03, 2016 4:45 pm

Sure. That seems reasonable for what you want too.
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

Dan12345
Posts: 6
Joined: Fri Sep 02, 2016 7:23 am

Re: Trigger notification as soon as alarm starts

Post by Dan12345 » Sat Sep 03, 2016 10:34 pm

On third thoughts, even swatch is overkill - awk does the trick, run at reboot with cron:

tail -F /var/log/syslog | awk ‘/FireEscape.*alarm start/ { system("wget http://[openhab server]/CMD?CamFireEscape=ON -P /tmp") }'

(and that flicks a virtual switch in my openHAB setup to run notifications etc)

JTheDoc
Posts: 11
Joined: Sun Aug 28, 2016 8:08 pm

Re: Trigger notification as soon as alarm starts

Post by JTheDoc » Thu Sep 08, 2016 4:09 am

Hello Dan, you don't happen to know how to implement your method so I may run a simple .sh script? I'm attempting to have a PTZ camera look a certain direction when motion is detected on another camera.

The script I've got working perfectly fine, I believe putting the script in a folder that www-data has permissions for, and setting the .sh to executable should be enough, but I haven't been able to put this into practice, as filters don't work (Doesn't work, and would be too slow to respond), so having awk trail the logs for "alarm" should be enough for me. If you could help, I would be very grateful! Thank you, and I hope you've been getting along better with ZM much less awkwardly and stressful as I have!
Cheers,

Josh.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests