How to receive the alerts email (step by step)

Support and queries relating to all previous versions of ZoneMinder
maximum
Posts: 19
Joined: Wed Aug 17, 2005 8:17 pm

How to receive the alerts email (step by step)

Post by maximum »

Hi all,

this is a little step by step requested in private about hot to setup ZM in order to receive emails of alert in any account email.

I put here that hoping is useful for the new-bye (like me) :-)

Assumption:

* ZM already installed and working
* ZM can detect movements and appear the alarm in red in the monitor window.
* The linux-box can send email from localhost (but i'm not sure that's is needed)
with the command like: echo test | mail -s test user@host (where user@host is something like max@yahoo.com)

1) set to Modect the webcam that change the her color in green
2) open the monitor window and check that the alarm are generated moving your hand in front of the webcam
3) press in All link
4) press ShowFilterWindow link
5) create a new filter with 2 filter expression

Code: Select all

				[ Monitor ID ]		[ equal to ]	[ 1 ]
[ and ]	[ Alarm Frames ]	[greater than ]	[ 5 ]	
6) in the top press "Save" an enter the name "Alarm"
7) check the option "Automatically email details of all matches"
8 ) press Save again. Close the Filter window and Event Window
9) from the main windows press the link Options/Email
10) check the option ZM_OPT_EMAIL
11) insert any email address in ZM_EMAIL_ADDRESS
12) insert in ZM_EMAIL_HOST "localhost"
13) insert in ZM_FROM_EMAIL something like "zm@bk.fw.conectat.org"
14) insert in ZM_URL something like http://bk.fw.conectat.org/zm

15) press Save in the bottom a restart ZM with: /etc/init.d/zm restart
16) open another terminal and check the log filter with:
$ tail -f /var/log/zm/zmfilter.log
17) Now try to provoke an alert moving your hand in front of webcam, you will see in the log that the email with 2 jpg frames will be sent in some seconds.

Note: after the test, you need to modify as needed the text contained in ZM_EMAIL_TEXT
If that's don't work check the zmfilter.log.
The filter is very basic and need to be improved.

that's all boys!

ciao
MaX
Last edited by maximum on Sat Aug 20, 2005 11:22 am, edited 2 times in total.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Hi MaX,
Thank you for taking time to do this. I'm sure it will be usefull.
Regards,
Cordel
ubell
Posts: 53
Joined: Sun Jul 24, 2005 9:05 pm

Post by ubell »

There seems to be no way to post mail directly to a remote
mail server that requires a password. Is this true?
I don't run a mail server and must go through my ISP
to send mail off my lan in any case.
maximum
Posts: 19
Joined: Wed Aug 17, 2005 8:17 pm

Post by maximum »

ubell wrote:There seems to be no way to post mail directly to a remote
mail server that requires a password. Is this true?
I don't run a mail server and must go through my ISP
to send mail off my lan in any case.
well ZM cannot do it, but you can configure your MTA.

I have read that Exim4 can send the emails to a smarthost using name/passwd.
Never i have do it, but i don't think that this is impossible to do.

Another way is to create a new account in yahoo.com for example and use it.

best,
MaX
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

Would it be possible to add smtp auth to zm, is the perl smtp able to, we might be able to modify the script that is used to incluse hard smtp auth info?

James
ubell
Posts: 53
Joined: Sun Jul 24, 2005 9:05 pm

no zmfilter.log and no mail

Post by ubell »

I figured out how to config sendmail to use my ISP (its in
the first few lines of sendmail.mc). But I cannot get zm
to send mail. I have things configured as in this topic but
I don't have a zmfilter.log and no mail. If I apply the
fiter if finds the events, but no mail.

Anything to check?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

are you using the live cd?
ubell
Posts: 53
Joined: Sun Jul 24, 2005 9:05 pm

Post by ubell »

I don't know what the "live cd" is.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

your not then lol
the reason i ask is i think there is a perl module for smtp missing from the live cd.
If you have no filter log it means you filters arnt funning. Try running the zmfilter script from the command line and see what it says in console.

James
ubell
Posts: 53
Joined: Sun Jul 24, 2005 9:05 pm

Post by ubell »

I finally noticed a log message that zmfilter could not find a module.
Now I am on a hunt for modules one by one... is there a list
somewhere of what pearl we need to download? All the README
file says is to run perl -MCPAN -eshell, but it doesn't tell you what
to do once you do that. The error messages refer to files
not modules so its quite a hunt to figure out what they should
be. Im stuck on:
Can't locate auto/Mail/Internet/autosplit.ix in @INC

Any clues?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

i think if you search the forum for dependancies cordel did a comprehensive list

James
ubell
Posts: 53
Joined: Sun Jul 24, 2005 9:05 pm

Post by ubell »

Ok, so I'm no perl jock but I spose I should have done
the make instead of just copying the files I thought I
needed. DOH! :-)

Im getting mail now.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

what modules were you missing?
ubell
Posts: 53
Joined: Sun Jul 24, 2005 9:05 pm

Post by ubell »

At least these:
Mail Mime IO-stringy Time-HiRes
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Missing perl modules are always a contributor to the none functioning email alerts.
You sould have been able to see in zmdc.log warnings that the modules were missing.
Regards,
Cordel
Locked