Difference between revisions of "SMS Notifications"

From ZoneMinder Wiki
Jump to navigationJump to search
Line 37: Line 37:


* service zoneminder restart in between changes
* service zoneminder restart in between changes
* test setting off alarms by clicking 'force alarm' in the monitor view


=== Example Filter ===
=== Example Filter ===

Revision as of 22:41, 24 March 2017

You setup email to point to a text gateway. Setup a filter that monitors the cameras for alarms, and when an alarm is set off you have it send an email to the text gateway. Simple.

You can get images from the alarm embedded in the text (covered in install steps).

Installation

Follow How to get ssmtp working with Zoneminder.

Tips

When testing be aware of the following:

  • Free email services limit how many emails you are allowed to send through SMTP. It helps to disable cron emails.
  • Always test by emailing 1 (or similar low number) results.
  • When you make the filter you want the 'current' alarms. You don't want old events.

This is accomplished with a Date/Time greater than or equal to -1 minute.

  • If when testing the filter execute, the 'execute' button becomes unclickable, uncheck then recheck the email option.
#watch "tail -n 30000 /var/log/syslog | grep sSMTP | tail"
  • When testing use submit at first, not execute. Submit will show you results but not email.
  • If you send email as someone other than root, make sure he is in /etc/ssmtp/revaliases
  • test emails with
cat file | mail -s "subject" destination@email.com
OR
echo "some text" | mail -s "subject destination@email.com
  • make sure email is checked off in filters. It gets unchecked easily.
  • service zoneminder restart in between changes
  • test setting off alarms by clicking 'force alarm' in the monitor view

Example Filter

For monitoring on the weekend you might have

date/time greater than or equal to -1 minute AND
alarm frames greather than or equal to 1 AND
Weekday equal to Saturday OR
Weekday equal to Sunday AND
alarm frames greater than or equal to 1 AND
date/time greater than or equal to -1 minute

Notice that you must include all parameters for each group/set individually when there is an OR.


Notes

Notifications are easy if you want alarms emailed between a static time, for example between 12AM and 6AM. If you have a situation where you may not want the alarms to send you text messages on occasion, this requires work.

A feature in the works would allow you to set filters based on run states, which would mean, you could change the run state at any desired time, and only then would SMS be sent. Until then, you must have duplicate monitors and have the filters activated on only one of them. If you like, you can compile zoneminder from a package source such as the debian package and add the commits manually at your own risk (it is not difficult, but beware updating).

Resources