Difference between revisions of "SMS Notifications"
(→Tips) |
|||
Line 24: | Line 24: | ||
* When testing use submit at first, not execute. Submit will show you results but not email. | * 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 | |||
<pre> | |||
cat file | mail -s "subject" destination@email.com | |||
OR | |||
echo "some text" | mail -s "subject destination@email.com | |||
</pre> | |||
=== Example Filter === | === Example Filter === |
Revision as of 20:24, 16 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.
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. However, there is no need to set this when testing.
Tips
- 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
Example Filter
For monitoring on the weekend you might have
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
TODO TEST
Notes
Notifications can be set easily if you want alarms emailed whenever an event occurs 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 which is not difficult, at your own risk