zmfilter.pl for SMS Server Tools

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
sognenovski
Posts: 12
Joined: Mon Sep 03, 2007 8:37 am
Location: Australia/Sydney

zmfilter.pl for SMS Server Tools

Post by sognenovski »

Hi All

I’ve made a code change in zmfilter.pl to output an event to a temp file.
The temp file is place in the spooling directory for smstools to process.
I suggest backing up zmfilter.pl first before you replace it with the link below.

# tail –f /var/log/messages

zma_m1[6638]: INF [kitchen: 128 - Gone into alert state]
zma_m1[6638]: INF [kitchen: 138 - Left alarm state (3107) - 102(82) images]
zmfilter[19124]: INF [Creating notification message]
zmfilter[19124]: INF [Sending notification message '491721234567 ']
zmfilter[19124]: INF [Notification message file created '/var/spool/sms/outgoing/zmsmstools.out.lyZo7']
zmfilter[19124]: INF [Notification message sent]


How?
1. Install smstools a confirm its working from shell with command: sendsms 491721234567 'Hello, how are you'
2. Setup event message filter as per normal.
3. Set check box ZM_OPT_MESSAGE to true value.
4. Add your mobile number to message subject field ZM_MESSAGE_SUBJECT.
5. Edit/add suggested string to ZM_MESSAGE_BODY ZM: ZoneMinder alarm detected. Monitor %MN%, Event Id %EI%.
6. Replace zmfilter.pl with the link below, restart ZM and trip cameras.

Tested on ZM 1.22.3 only.
http://socomms.com/contrib/scripts/

I guess this also could be altered to suit gnokii, or any other application that requires an output event to a temp file.

Comments, suggestions and flaming accepted :)

Enjoy!
Steve

Reference
http://www.hayne.net/MacDev/Perl/writeToTempFile
Last edited by sognenovski on Sun Mar 30, 2008 10:53 am, edited 3 times in total.
sognenovski
Posts: 12
Joined: Mon Sep 03, 2007 8:37 am
Location: Australia/Sydney

Post by sognenovski »

oh, almost forgot,

set permissions on smstools directory
# chmod 777 /var/spool/sms/outgoing
# chown root:shared /var/spool/sms/outgoing

thx
behdha
Posts: 15
Joined: Thu Feb 07, 2008 12:20 pm

Sms on Ubuntu

Post by behdha »

Hi Steve,

Thanx for all you're good sugestion, one question, do i need gnokii or smstools because on ubuntu when i install smstools and type sendsms 4234234123 then the systems asks if i want to install gnokii when i do that he removes smstools, so i'm i bit confused!

My setup will be pv-149 from bluecherry, AMD or Intel dual core quad 2.4 ghz at least 4 gb of memory 8 analog camera's, telephone with usb cable to machine with smstools or gnokii with you're scripts if i manage to get it working, because i live in holland and the project is in portugal, so it needs to be complete before i get over there, can you help me out a bit with the sms thing.

Thanx,

Dave
sognenovski
Posts: 12
Joined: Mon Sep 03, 2007 8:37 am
Location: Australia/Sydney

Post by sognenovski »

You need smstools for the above to work.
Don’t use Ubunto but, if was going to have a guess…gnokii is set as the preferred daemon for sendsms. Take a look at Ubunto apt-get configuration.

How did you install smstools?
behdha
Posts: 15
Joined: Thu Feb 07, 2008 12:20 pm

Confused

Post by behdha »

Hi,

Could you be more specific please about sending sms trhough the scripts you made, in steps, i am busy to make an tutorial based on Ubuntu 8.04 LTS server nad want to implement this as a feature.


Thnx

Dave
behdha
Posts: 15
Joined: Thu Feb 07, 2008 12:20 pm

Installed SmsTools by source on ubuntu 8.04

Post by behdha »

Hi,

I installed SmsTools by source on ubuntu 8.04 according to the instruction here on the site -- > http://smstools3.kekekasvi.com/index.php?p=configure

Sending sms like you described on the command line through sendsms 1234567890 ' This is a test' WORKS !!!

But now i want to place the files you are talking about " writeToTempFile.pl zmfilter-filetemp.pl zmfilter-original.pl zmfilter-smstools.pl" in the correct directories, could you please help, because the steps you mentioned are a bit unclear to me. I replaced the zmfilter-smstools in my /usr/local/bin/ directory as zmfilter.pl and the orignal one i backed up. where do i place the zmfilter-filetemp.pl ? Maybe in /var/spool/sms/** I really don't know. Please can you help me. I also triggered my camera with an filter i applied that worked with the original zmfilter.pl.

Thanx in advance,

Dave


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

gnokii

Post by johnnytolengo »

Did you try Gnokii? I am using gnokii with nokia phones through USB it is really easy.

Regards.

J.
User avatar
kingofkya
Posts: 1110
Joined: Mon Mar 26, 2007 6:07 am
Location: Las Vegas, Nevada

Post by kingofkya »

nice work

This is more of a general Zoneminder suggestion but with all theses zm filter mods it might be a good idea to have a modules folder for custom zm filters
johnnytolengo
Posts: 184
Joined: Tue Oct 14, 2008 5:59 pm

Post by johnnytolengo »

I don't know what you mean but with gnokii I did nice works.
just buy an old nokia telephone with a DKU-5 usb cable then...


1.apt-get install nokii
2.configure the phone
3.make file with called sendsms.sh with content: echo "gnokii sendsms 234xxxx| hello "

4. go to the filter and use the fill for custom script : mifolder/sendsms.sh


ready.

J.
Post Reply