Documentation for newbie programers

Forum for questions and support relating to the 1.24.x releases only.
Post Reply
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

Documentation for newbie programers

Post by johnnytolengo » Tue May 26, 2009 11:20 pm

Hello, i am new in ZM and i want to do some improvments for my homeZM,
i am studing how the perl componets works. I need to do some changes in my box at the moment in zmfilter.pl, but i don't know where the variables in it come from. "ZM_EMAIL_SUBJECT, etc"

Other mysterious is : i did a change in zmfilter.pl , i added a line inside a function "sub sendEmail" this function sends emails when a alarm happened.

My add:

system("touch /usr/src/myfile.txt");


The filter works correctly i recieved the email all seems to be allright BUT

the file named myfile.txt was never created. so... WHAT'S UP?


I just need some documentation to understand the process of the things in this scripts and some other info.


This doc could be a big step for zoneminder, because i read that are a lot of people in this forum which wants to make improvments but they have not the path (documentation) to do it.


May i am the only dokey who haven't this manual, am I ? :D

Sorry i want to share my ideas. :)

Thanks for your time.

J.

User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Post by rdmelin » Tue May 26, 2009 11:57 pm

First regarding zmfilter.pl. The variable ZM_EMAIL_SUBJECT (constant actually) comes from the database Config table, and can be set in the email tab of the Option window in the web interface.
zmfilter.pl is run by the web user (apache, http, or other depending on your distro) so it does not have permission to write to /usr/src/

The Documentation is the wiki
http://www.zoneminder.com/wiki/index.php/Welcome
Also scattered throughout this forum.
You are welcome to add to and improve it :)

johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

Post by johnnytolengo » Wed May 27, 2009 12:15 am

Thanks for your reply but wiki has almost user info not for us or me. :)

i an freezed in this point:

My add:

system("touch /usr/src/myfile.txt");


The filter works correctly i recieved the email all seems to be allright BUT

the file named myfile.txt was never created. so... WHAT'S UP?


All what instrunctions i add there never comes to work.


Anyway i when i resolve it i'll post a feature for SMSing , gnokii. I want to receive sms notifications when: some alarm occurs, when some camera stop to work. This i want to add to the filter.


Thanks.

J.

MrEvoMan
Posts: 55
Joined: Thu Apr 23, 2009 1:25 am

Post by MrEvoMan » Wed May 27, 2009 12:34 am

Most likely this is a permissions problem.

Pretty sure the zmfilter.pl script runs as www-data (default) and I'm pretty sure that this user id doesn't have write permissions to that directory.

johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

Post by johnnytolengo » Wed May 27, 2009 9:12 am

I try 777 perm and www-data group+own. But still does not react :(

The touch is a simply test, it can be there what else.

If i put before --> Info( "Sending notification sms \n" );

another notification like

--> Info( "I am testing \n" );

then i can se this in my log but not my system() action;


I seems that zmfilter.pl is read when ZM starts and then the script runs from another side, not that /usr/bin/zmfilter.pl

It's so extrange, my God!


J.

belanger
Posts: 19
Joined: Wed Apr 15, 2009 10:09 am

Post by belanger » Wed May 27, 2009 12:01 pm

johnnytolengo wrote: My add:

system("touch /usr/src/myfile.txt");
/usr/src is NOT a good place at all to create a file. Use /tmp or /var/tmp or create a directory in /var/... or /home/... owned by www-data user & group.

Pierre B.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests