ZoneMinder 1.25x doesn't send any email alert, or SMS alert.

Forum for questions and support relating to the 1.25.x releases only.
Locked
Cubytus
Posts: 32
Joined: Sun Oct 14, 2012 6:30 pm

ZoneMinder 1.25x doesn't send any email alert, or SMS alert.

Post by Cubytus »

Hi there,

still another issue with ZoneMinder, it seems unable to send any alert when movement is deteceted and locally recorded. I checked servers twice, but I don't know why it keeps on failing.

Any hint to know where to start the debugging process?
dma_k
Posts: 27
Joined: Sat Jan 19, 2013 5:58 pm

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by dma_k »

I have somehow similar issue.
  • I have configured ZoneMinder and filters as described here.
  • I have defined a condition "Total score >= 10".
  • For the camera I see the following log in events' list

    Code: Select all

    Id	  Name				  Time		 Secs				Frames	Score 	 
    7870	front-door-7870	2013-02-15 19:56:35	1.88	30/10	9/10	X
    7869	front-door-7869	2013-02-15 19:56:31	1.66	25/5	24/28	X
    
    but nothing is actually reported to email and there is nothing strange in logs.
How to debug this functionality?

Also maybe somebody can give a hint: How the "Score" column is decoded? What "9/10" means (9 is total score or 10 is total score)? Thanks!
Cubytus
Posts: 32
Joined: Sun Oct 14, 2012 6:30 pm

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by Cubytus »

It seems that not so many people were able to get ZoneMinder to work. It appears as if there were too many components and sub-components not playing well with now-standard Ubuntu defaults (such as disk encryption). If you primary goal is to tinker with videosurveillance and learn a few things in the middle, stay ZoneMinder.

If you're only concerned about reliably keep an eye on your belongings, switch to Motion (though you will probably have to script actions to perform, besides the actual recording. Luckily they have a mailing list with knowledgeable people in it), Bluecherry (only for IP cameras, not cabled ones) and the not-so-bad Blue Iris.

I am putting "not-so-bad" because although it is limited by Windows incompatibilities (no native SSL connections, for example, or will crash because of unstable camera drivers, or -previously- incompatible encoding methods), with decent hardware it can do what is expected from it. I was told the new version even has h264 recording now!

On a Mac, you can always go SecuritySpy, which is quite expensive and whose ergonomics defy logic.

None of them are free except Motion, but as they seem to be small, independent developers, just keep in mind the price of the software itself is inferior to the one of a good quality video camera.
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by PacoLM »

It's funny, a thread started with a question (or problem), and now we have a lesson about surveillance software in many different operating systems.
Cubytus wrote:It seems that not so many people were able to get ZoneMinder to work.
When did you made the poll?.... based in your "huge" experience (25 posts/4 months in the forum)? This is not true, Zoneminder works in many different Linux distributions (I tested it myself, not talking for free), in many different hardwares (ARM based, Intel based, etc), again, tested in person.
Setting up Zoneminder requires a soft learning curve and spend some reading the forum, but assuming the NOT SO MANY people were able to get Zoneminder work seems a personal assertion based in personal fustration (?)
Cubytus wrote:It seems that not so many people were able to get ZoneMinder to work.
If you're only concerned about reliably keep an eye on your belongings, switch to Motion (though you will probably have to script actions to perform, besides the actual recording. Luckily they have a mailing list with knowledgeable people in it)
Have you tested it yourself?. I did, and Zoneminder is way easier to install, maintain and more powerful than Motion (even it is a good software!) and Kmotion (the web interface for Motion).

Regards,

PacoLM

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
Cubytus
Posts: 32
Joined: Sun Oct 14, 2012 6:30 pm

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by Cubytus »

PacoLM wrote:(...)
When did you made the poll?.... based in your "huge" experience (25 posts/4 months in the forum)? This is not true, Zoneminder works in many different Linux distributions (I tested it myself, not talking for free), in many different hardwares (ARM based, Intel based, etc), again, tested in person.
Setting up Zoneminder requires a soft learning curve and spend some reading the forum, but assuming the NOT SO MANY people were able to get Zoneminder work seems a personal assertion based in personal fustration (?)
Having posted a topic 4 months ago with NO answer or even asking for clarification of the issues I am facing leads me to think that nobody was ever confronted with the same issue. I tried to make the problems statements as explicit as possible, keeping one topic per problem. The only advice I got about the filters ended up not working, and no one answered it or asked for clarifications, logs, etc, side from "Have you installed ZIP?", which was already installed as it was running on a vanilla Ubuntu distribution.. Truth is ZM is a very complex piece of software, and it's quite hard to know where to start. Remember a surveillance software isn't a toy, but must serve its purpose right away. Spending weeks or even days reading the forums, looking for someone who experienced a similar issue and had it actually solved is leaving the place un-recorded for as many days or weeks.

On the contrary, with ZoneMinder you have to follow an extremely steep learning curve where you have to tackle a tons of problems at once. I appreciate that a piece of software wants to undertake it all, if it were ready to run out-of-the box. First, it never worked properly on Fedora, although it is supposed to be its primary platform: I had to disable the AppArmor policy, and this wasn't said anywhere in the forum. As I got fed up trying on Fedora, I got Ubuntu, where it never went past local recording, and even that didn't go very well as there was no way to prevent the disk from filling up out of the box.

Right from the start, I was unable to:
0- get ALL my cameras working because I couldn't find how to set the arcane settings ZM asks for and auto-detect always gave a "255" error (chinese cloned cameras surely don't help, but Cheese has no problem getting a picture out of those).
1- autodelete of older events to prevent OS crash, keeping an arbitrary number of GB free at all times
2- compress motion events, either as ZIP or TAR.
3- upload events to a SFTP server or FTP
4- send alert emails to both SMS gateway and standard email, with or without attachment

In other words, ZoneMinder never served its purpose.
Have you tested it yourself?. I did, and Zoneminder is way easier to install, maintain and more powerful than Motion (even it is a good software!) and Kmotion (the web interface for Motion).

Regards,

PacoLM
I have, and I had only one issue with Motion: when the action script was called each time motion was detected, it would saturate the router with connections and made it crash. So the issue was single and probably can be tackled with a bit of external advice on the mailing lists or forums.

I actually tested each of these software, but now I would like it to perform its duty and leave me in peace :)
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by jameswilson »

i disagree with your comments but everyone has their own opinion i suppose

but
0- get ALL my cameras working because I couldn't find how to set the arcane settings ZM asks for and auto-detect always gave a "255" error (chinese cloned cameras surely don't help, but Cheese has no problem getting a picture out of those).
1- autodelete of older events to prevent OS crash, keeping an arbitrary number of GB free at all times
2- compress motion events, either as ZIP or TAR.
3- upload events to a SFTP server or FTP
4- send alert emails to both SMS gateway and standard email, with or without attachment

In other words, ZoneMinder never served its purpose.

0, Im assuming IP cameras but i dont know what cheese is.
1, Its there but you need to enable the filter. Its disabled by default.
2, Can be done but you save much if any diskspace that way. I think whot you mean is transcoding the event into another format.
3, Again doable but need to create the filter and needs care else it will swamp your bandwidth
4, it does do this.

ZM is very powerful and flexible but the manual does tell you to do these things. If you have used ubuntu have you followed the wiki guides?
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
dma_k
Posts: 27
Joined: Sat Jan 19, 2013 5:58 pm

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by dma_k »

Dear all,

I think we have deviated from the subject. The question is: how to trace down what is not working in filtering mechanizam?

First of all if I increase LOG_LEVEL_FILE up to DEBUG, grep filter /tmp/zm/zm_debug.log* returns nothing. Then I have checked that zmfilter.pl was actually started in background:

Code: Select all

# ps ax | grep filter
24623 pts/1    S      0:00 /usr/bin/perl -wT /usr/bin/zmfilter.pl
and then I would expect that there is a file /tmp/zm/zm_debug.log.24623, but it does not exist.

However increasing LOG_LEVEL_SYSLOG gave some results:

Code: Select all

Feb 20 15:51:35 zmdc[24170]: INF ['zmfilter.pl' starting at 13/02/20 15:51:35, pid = 24218]
Feb 20 15:51:35 zmdc[24218]: INF ['zmfilter.pl' started at 13/02/20 15:51:35]
Feb 20 15:51:36 zmfilter[24218]: INF [Scanning for events]
but there nothing else except these messages. I have FILTER_EXECUTE_INTERVAL set to 10, so I would expect that there is some debug message from zmfilter every 10 seconds. I have a feeling that debug messages are still not bumped to syslog, as they all have INF level.

Now the only way out I see is to dig into /usr/bin/zmfilter.pl to see what is going on.

P.S. I have personally chosen ZoneMinder because it is available in Debain repository. That simplifies the updates.
Cubytus
Posts: 32
Joined: Sun Oct 14, 2012 6:30 pm

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by Cubytus »

0- you're assuming wrong. These are standard USB webcams.
1- what's the goal of disabling a filter that is essential to stability? For information, one can't just go in the listing of events to delete a few when disk has 0 bytes left. Deleting files by hand leads to inconsistency in the database that will prevent ZM from starting afterwards.
2- I didn't expect any annual compression, only to get a single file to upload instead of many ones.
3- I followed advice received here, copying the exact criteria set forth as an example, and it failed to send anything. Maybe has something to do with number 2, as well as does 4.

I have followed the wiki, third party guides, and was never successful before turning to the forum, which didn't lead to any expected behavior. As an example, no wiki entry warned against using disk encryption or that it would be necessary to deactivate the AppArmor policy.

I'll see what can be extracted from a debug version of the logs.
Last edited by Cubytus on Wed Feb 20, 2013 7:38 pm, edited 2 times in total.
dma_k
Posts: 27
Joined: Sat Jan 19, 2013 5:58 pm

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by dma_k »

After adding some more debug messages I have found out that filter needs to be marked as "Run in background":

Code: Select all

select * from Filters where Background = 1 and ...
I didn't pay attention to this checkbox when I was saving the filter.

How to interpret this option? What would it mean "run filter in foreground"?
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by jameswilson »

Cubytus wrote:0- you're assuming wrong. These are standard USB webcams.
1- what's the goal of disabling a filter that is essential to stability? For information, one can't just go in the listing of events to delete a few when disk has 0 bytes left. Deleting files by hand leads to inconsistency in the database that will prevent ZM from starting afterwards.
2- I didn't expect any annual compression, only to get a single file to upload instead of many ones.
3- I followed advice received here, copying the exact criteria set forth as an example, and it failed to send anything. Maybe has something to do with number 2, as well as does 4.

I have followed the wiki, third party guides, and was never successful before turning to the forum, which didn't lead to any expected behavior. As an example, no wiki entry warned against using disk encryption or that it would be necessary to deactivate the AppArmor policy.

I'll see what can be extracted from a debug version of the logs.
0, ok but ive personally never used usb cams. So i cant really help there. But if they can be seen in linux then zm should be able to use them
1, i can see that point but also the reverse is true if it deleted stuff on its own then zm could be critisised. Plus if you use seperate partitions for your storage it wouldnt break the os.
2, ok
3, Unknown. All i know is it can and i have used it to do so. It could be many things.

re other post and foreground vs background. Background tasks work automatically forground tasks are there to be called manually only.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by jameswilson »

Cubytus wrote:0- you're assuming wrong. These are standard USB webcams.
1- what's the goal of disabling a filter that is essential to stability? For information, one can't just go in the listing of events to delete a few when disk has 0 bytes left. Deleting files by hand leads to inconsistency in the database that will prevent ZM from starting afterwards.
2- I didn't expect any annual compression, only to get a single file to upload instead of many ones.
3- I followed advice received here, copying the exact criteria set forth as an example, and it failed to send anything. Maybe has something to do with number 2, as well as does 4.

I have followed the wiki, third party guides, and was never successful before turning to the forum, which didn't lead to any expected behavior. As an example, no wiki entry warned against using disk encryption or that it would be necessary to deactivate the AppArmor policy.

I'll see what can be extracted from a debug version of the logs.
0, ok but ive personally never used usb cams. So i cant really help there. But if they can be seen in linux then zm should be able to use them
1, i can see that point but also the reverse is true if it deleted stuff on its own then zm could be critisised. Plus if you use seperate partitions for your storage it wouldnt break the os.
2, ok
3, Unknown. All i know is it can and i have used it to do so. It could be many things.

re other post and foreground vs background. Background tasks work automatically forground tasks are there to be called manually only.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Cubytus
Posts: 32
Joined: Sun Oct 14, 2012 6:30 pm

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by Cubytus »

jameswilson wrote: 0, ok but ive personally never used usb cams. So i cant really help there. But if they can be seen in linux then zm should be able to use them
1, i can see that point but also the reverse is true if it deleted stuff on its own then zm could be critisised. Plus if you use seperate partitions for your storage it wouldnt break the os.
2, ok
3, Unknown. All i know is it can and i have used it to do so. It could be many things.

re other post and foreground vs background. Background tasks work automatically forground tasks are there to be called manually only.
The reason for 0 is that webcams are actually the cheapest and most straightforward way to record a picture. If I could get webcams to work, then I may start thinking about IP cameras. Even a cheap IP cam is $50, that's not small change.
1- For this point, I can understand that ZM may have been criticized if it didn't explicitely tell about this filter. But then again, being criticized because some events would have been deleted due to lack of hard drive space, or being criticized because of a currupted database due to 0-bytes left on the drive, which one is worse? Don't get me started on paths. ZoneMinder has EIGHT paths to cater to, and it is not clear from the start how these different paths are used and in what order when an upload file is created. This raised the number of possible failure points. Besides, I first used a recommended setup for Ubuntu and Fedora: have a separate /home partition. I understand that GNU/Linux's norm is to use one path for a precise purpose and not anything else. However, this greatly complicates matters for end-users who just want a worry-free recording system (after all, isn't videosurveillance all about being freed from worries?). It would be much more flexible if it resided as user application, within the /home directory.

As for the upload filter, it was set to run in the background as shown here, with the exact same settings. With debug logging, I get this:

Code: Select all

Feb 22 00:06:08 usager-R510-G-ABM3A9 zmfilter[25232]: ERR [Zip error: 4#012 ]
Feb 22 00:06:08 usager-R510-G-ABM3A9 zmfilter[25232]: INF [Creating upload file '/home/user/Videos/upload/Webcam-8.zip', 3371 files]
Feb 22 00:06:10 usager-R510-G-ABM3A9 zmfilter[25232]: ERR [Zip error: 4#012 ]
Feb 22 00:06:10 usager-R510-G-ABM3A9 zmfilter[25232]: INF [Creating upload file '/home/user/Videos/upload/Webcam-9.zip', 12823 files]
Feb 22 00:06:15 usager-R510-G-ABM3A9 zmfilter[25232]: ERR [Zip error: 4#012 ]
Zip files not being created, I assume it can't be uploaded.

Alerts are not sent either:

Code: Select all

Feb 22 00:07:07 usager-R510-G-ABM3A9 nullmailer[1204]: Starting delivery: protocol: --port=25 host: mail.myserver.net file: 1361105401.2235
Feb 22 00:07:07 usager-R510-G-ABM3A9 nullmailer[1204]: Sending failed:  Could not exec program
Feb 22 00:07:07 usager-R510-G-ABM3A9 nullmailer[1204]: Starting delivery: protocol: --port=25 host: mail.myserver.net file: 1356242906.5525
Feb 22 00:07:07 usager-R510-G-ABM3A9 nullmailer[1204]: Sending failed:  Could not exec program
Feb 22 00:07:07 usager-R510-G-ABM3A9 nullmailer[1204]: Starting delivery: protocol: --port=25 host: mail.myserver.net file: 1360501076.25589
Feb 22 00:07:07 usager-R510-G-ABM3A9 nullmailer[1204]: Sending failed:  Could not exec program
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by PacoLM »

?
Last edited by PacoLM on Fri Mar 01, 2013 1:38 am, edited 1 time in total.

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
Cubytus
Posts: 32
Joined: Sun Oct 14, 2012 6:30 pm

Re: ZoneMinder 1.25x doesn't send any email alert, or SMS al

Post by Cubytus »

PacoLM wrote:Both (Zip and email) works in my system (debian wheezy server). And also worked in Zoneminder installed in a Cubox (ubuntu, archlinux, debian), a Guruplug server plus (debian), a Raspberry Pi (debian) and some Intel based computers (debian, ubuntu, archlinux) I´ve played with for years...
So, it's your configuration/system/installation, not Zoneminder.

1- Could you try to manually run the zip filter (I mean, zip the files using the command line), maybe the script uses some flag that is not supported by the version of zip installed.

2- Instead of using nullmailer, use postfix, I could help you setting it up if you have problems.

Regards,

PacoLM
Oh, the all-mighty "it works on my machine". Mine is a vanilla Ubuntu 12.04LTS, nothing more, nothing less. I didn't dare try the server version yet that would normally be recommended for maximum performance.

1- WORKS with command:

Code: Select all

$ zip -r /home/usager/Videos/upload/test.zip /usr/share/zoneminder/events/1/12/12/26/02/13/19/
I don't know what flags are used by ZoneMinder when zipping. As told by the (?), I checked if Archive::Zip module was installed. And indeed libarchive-zip-perl is installed, as indicated in Synaptic. Just to make sure, I also installed libarchive-any-perl module.

All log files were set to output debug level info:
I still get tons of these lines, with each time a similarly named filed, and always the same error.

Code: Select all

Feb 27 23:33:50 usager-R510-G-ABM3A9 zmfilter[26082]: INF [Creating upload file '/home/user/Videos/upload/Webcam-2.zip', 260 files]
Feb 27 23:33:51 usager-R510-G-ABM3A9 zmfilter[26082]: ERR [Zip error: 4#012 ]
Looking in google with zmfilter.pl "zip error" as a key phrase, I found that page, apparently the source code for zmfilter.pl. Then I looked for zip man page status code keyword and found this page, as I understood zmfilter would output the exit status of zip ĉommand in case of error, status 4 being:

Code: Select all

          4    zip was unable to allocate memory for one or  more
               buffers during program initialization.
And I still don't understand what it means. There's plenty of free RAM, 15GiB free on the system partition and 150GiB free on the partition on which are stored events.


2- One problem at a time, I will try to set either nullmailer or postfix once I get the upload system working.
Locked