Page 1 of 1

Email notifications - noob question

Posted: Thu Apr 12, 2007 11:35 pm
by wilso027
I have zoneminder on Ubuntu Edgy and was hoping to use the ZM_NEW_MAIL_MODULES section to use postfix to send email notifications out.

I set it up but I have not figured out how to create a filter to actually test it.

Do you use the "Execute command on all matches" section and then have it run in the background?

Can someone post a quick howto on setting up email notifications.

Sorry I feel like I am missing something simple here but I am just not getting it.

Allan

Email

Posted: Sun Apr 15, 2007 11:16 am
by corey205
I have also been playing with this and would really appreciate some comments on how this works.

Thanks! :-)

Posted: Wed Apr 18, 2007 12:39 am
by wilso027
Corey205, have you gotten it to send out any emails? Any elaboration on what you have done so far would be great. Come on we know some of you lurkers out there have email notifications working.

Emails

Posted: Wed Apr 18, 2007 12:24 pm
by corey205
Yeah, I think I have email's working. This is what I did.

Option's > Email.

Code: Select all

Ticked                       = ZM_OPT_EMAIL
ZM_EMAIL_ADDRESS =  me@localhost.localdomain

Ticked                       = ZM_NEW_MAIL_MODULES
ZM_EMAIL_HOST       = localhost.localdomain
ZM_FROM_EMAIL       = tst@tst.com
ZM_URL                    = 192.168.0.4
Then I went Filters > Show Filter Window

I created a filter called test, it has Avg Score > 15.

I ticked "Email details of all matches"
and "Execute command on all matches" (This is the one I really want to work, though it won't affect emailing.)

Then I pushed “execute”. Every candidate event was emailed to me. Note that if you get no events returned in the filter window, you have no candidate events. Try lowering the avg score.

To run in real time, save the filter with the “Run in background” box ticked in the save dialogue.

You can check to see if the email routines are running by monitoring the messages log. (var/log/messages)

The problem I have is the script in "Execute command on all matches" does not seem to execute. There is a message in the messages log that says it has been run. But it produces no output. Here is the script, as you can see it’s very simple.

Code: Select all

#!/usr/bin/perl -w
$ENV{PATH}  = '/bin:/usr/bin';
$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL};
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
system("date >> /temp/test.txt")
Any thoughts on why this is failing? It works fine when I run it manually as a regular user.

Posted: Wed Apr 18, 2007 5:56 pm
by wilso027
I'm trying it on my end and I will let you know how it does. Thanks for sending what you have done so far.

Allan

I am having problems....so close but no e-mail yet

Posted: Fri Jun 01, 2007 6:57 pm
by john.a.sutherland
I get this from my messages:

Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Creating notification message]
Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Sending notification message 'ZoneMinder: Alarm - Front_Door-111']
Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Archiving event 112]
Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Creating notification email]
Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Sending notification email 'ZoneMinder: Alarm - Front_Door-112 (32 - 10 25)']

Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Creating notification message]
Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Sending notification message 'ZoneMinder: Alarm - Front_Door-112']
Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Archiving event 117]
Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Creating notification email]
Jun 1 08:00:28 linux2 zmfilter[12906]: INF [Sending notification email 'ZoneMinder: Alarm - Front_Door-117 (70 - 27 291)']


Looks like it never sends. Not sure if I got the ZM URL right, my machine is not accessible from outside the internal network if that matters. I just put http://localhost/zm/zm.php, is that right? I do get the ZM main screen when I use that, but is that what the e-mail settings needs/wants?

Any ideas on how to troubleshoot?

Thanks,

John