Page 1 of 1
Periodical email inform of running system and cameras
Posted: Mon Jul 13, 2009 6:29 pm
by johnnytolengo
Hi, I am interested in a new feature for ZM, would be perfect to get once day an email notification that ZM system and all cameras (analog & IP) are running.
Do you have some ideas or experiences with this?
Thanks.
J.
Posted: Fri Jul 17, 2009 6:53 pm
by rcswrc
Maybe you should try bash or perl for making an script which connects to database and selects the state of your cameras, then email it using a cron job.
I haven't found any option on zoneminder that can do that.
I already did a similar perl script that connected to a postgresql database, that won't work for you but here is a part:
Code: Select all
#!/usr/bin/perl -w
#use strict;
use CGI qw(:standard);
use DBI;
#make script that connects to database and stores data on $databasedata
#this will send the email
#You need to have sendmail and perl of course
envio("test\@domain.com","other\@domain.com","Subject ",$databasedata);
sub envio {
my ($email, $otro_email ,$subject,$message) = @_;
open MAIL, "| /usr/lib/sendmail -t -i" or die "Can't open sendmail: $!";
print MAIL <<END_OF_MESSAGE;
To: $email
Reply-To: $otro_email
Subject: $subject
Mail send using sendmail and perl:
$message
END_OF_MESSAGE
close MAIL or die "Error cerrando sendmail: $!";
}