Seperate Zone Alerts
Seperate Zone Alerts
Right now I have to create a second monitor so I can seperate alerts on the same camera. I would like the ability to seperate alerts (email for a specific zone alert, not all alerts in any zone per monitor). Example: I like to monitor my front lawn as well as the road in front (due to some riff-raff as of late). I want to only be alerted (via emali) about perimiter breaches on my property, but I also want events created for any time something in zone2 (street traffic) causes an alert as well.
Re: Seperate Zone Alerts
Hi,
It can be done although it requires a bit of scripting. In zoneminder create a filter that runs a command (let's say /usr/local/bin/zm-alarm).
The script needs to be something similar to:
From here on you can use the $ZONE variable to send you an email if it matches the name you defined for your lawn and even better, if the alarmed frames is above a threshold and also the score.
I'm filtering a lot of false positives (score < 50) and alarmed frames < 10 using this script and I'm also generating a filelist using the alarmed frams as a hyperlink in the email for easy viewing (without requiring logging to zoneminder).
It can be done although it requires a bit of scripting. In zoneminder create a filter that runs a command (let's say /usr/local/bin/zm-alarm).
The script needs to be something similar to:
Code: Select all
#!/bin/bash
Z=$@
MONITOR=`echo $Z|cut -d\/ -f 6`
DAY="20"`echo $Z|cut -d\/ -f 7,8,9|sed 's/\//-/g'`
TIME=`echo $Z|cut -d\/ -f 10,11,12|sed 's/\//:/g'`
QUERY=`mysql -s -N -u(*your username*) -p(*your password) zm -e "select * from Events where MonitorId=$MONITOR and StartTime='$DAY $TIME'"`
ID=`echo $QUERY|awk '{print $1}'`
ALARMFRAMES=`mysql -s -N -u(*username*) -p(*password*) zm -e "select * from Events where Id=$ID"|awk '{print $13}'`
SCORE=`mysql -s -N -u(*your username*) -p(*password*) zm -e "select * from Events where Id=$ID"|awk '{print $14}'`
ZONE=`mysql -s -N -u(*your username*) -p(*password*) zm -e "select * from Events where Id=$ID"|awk '{print $23,$24,$25,$26,$27}'`
From here on you can use the $ZONE variable to send you an email if it matches the name you defined for your lawn and even better, if the alarmed frames is above a threshold and also the score.
I'm filtering a lot of false positives (score < 50) and alarmed frames < 10 using this script and I'm also generating a filelist using the alarmed frams as a hyperlink in the email for easy viewing (without requiring logging to zoneminder).