Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

How to install Zoneminder 1.30 on a 9.10 jail

StevieBBQ

Newbie
Joined
Feb 4, 2017
Messages
11
I wonder if it'd be worth having a thread on the cameras that FreeNAS users have put in to use and their experiences with them? Is there anything like that on the ZM forums?
There are a number of threads there that are all over the place. The ZM wiki has a long list by brand and model.
 

scrappy

FreeNAS Experienced
Joined
Mar 16, 2017
Messages
347
I wonder if it'd be worth having a thread on the cameras that FreeNAS users have put in to use and their experiences with them? Is there anything like that on the ZM forums?
I think ZM has a camera wiki.

That said, The Foscams I use with ZM used to work great for me. Unfortunately, they are so old now, only one cam sorta works. I've been meaning to buy some replacement cams for a while now. :/
 
Joined
Nov 30, 2017
Messages
2
I installed ZM over the weekend and couldn't get zmNinja (iOS) to work or any API commands until I created two directories:
api/app/tmp/cache/persistent
api/app/tmp/cache/models
I followed these instructions and also did not get the API to work. I have created these 2 directories, but I am still not getting anything but a blank page from the API.

I see this in the nginx error log a lot :
[error] 72554#102548: *1474 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to undefined function apc_fetch() in /usr/local/www/zoneminder/api/lib/Cake/Cache/Engine/ApcEngine.php:78
 
Joined
Nov 30, 2017
Messages
2
I had initially installed via the package method in the instructions. But I realized afterwards that it doesn't work quite the way the instructions expect. The zoneminder package requires php5.6, and forces pkg to uninstall php7.

So I trashed the jail and started again, this time building zoneminder myself. It works better now, but the API is still non-functional. The package method failed to log anything, including to the database log. Building it myself, the database log now works, but I still fail to have any logs in /var/log/zm. This and the broken API probably both indicate permission problems somewhere.
 
Joined
Dec 13, 2017
Messages
2
Hi, thanks for the guide https://drive.google.com/file/d/0B6clHa5IX562UW5ja3NTbnhvcjQ/view

I did something wrong.

Everything works except streaming video. In log:

Socket /var/run/zm/zms-373649s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information.

getStreamCmdResponse stream error: Socket /var/run/zm/zms-373649s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information. - checkStreamForErrors()

getStreamCmdResponse stream error: socket_bind( /var/run/zm/zms-373649w.sock ) failed: Address already in use - checkStreamForErrors()

socket_bind( /var/run/zm/zms-373649w.sock ) failed: Address already in use

help me?
 
Last edited:
Joined
Dec 13, 2017
Messages
2
Hi, thanks for the guide https://drive.google.com/file/d/0B6clHa5IX562UW5ja3NTbnhvcjQ/view

I did something wrong.

Everything works except streaming video. In log:

Socket /var/run/zm/zms-373649s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information.

getStreamCmdResponse stream error: Socket /var/run/zm/zms-373649s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information. - checkStreamForErrors()

getStreamCmdResponse stream error: socket_bind( /var/run/zm/zms-373649w.sock ) failed: Address already in use - checkStreamForErrors()

socket_bind( /var/run/zm/zms-373649w.sock ) failed: Address already in use

help me?
Figured out!!!

Web-interface / options / path - PATH_ZMS = cgi-bin/nph-zms
# it was as - /cgi-bin/nph-zms - I removed the first slash
 

pakka

Newbie
Joined
Jan 25, 2018
Messages
37
for me I still get no live stream and have no picture to configure a zone. Log-file says "The system has fallen back to single jpeg mode for streaming. Consider enabling Cambozola or upgrading the client browser.". Have you been forced to install cambozola for IE? Whatever this is...
In Chrome on Windows nothing worked... I get a horrible, scary site reminding me on windows 98... but I am not able to view in log-file or anything else..

But in the android app zmninja it seems to work fine! I have a livestream and can see videos.

Has anyone else problems with IE and Chrome on Windows?
 

StarkJohan

Newbie
Joined
Mar 27, 2015
Messages
59
The link to the document seems to be dead... sitting here and waiting for the Zoneminder port and all dependencies to finish up installing so I guess I will be needing a few hints shortly.
 

fracai

FreeNAS Guru
Joined
Aug 22, 2012
Messages
1,205
I think I have that original document backed up somewhere. I also started on an iocage script to automate most of it. The unfortunate part is that there are several config files that need to be edited in different locations. That doesn't lend itself easily to just mounting a configuration directory. Alternatively, it'd be possible to just copy the already edited files in to place. I'll repost the document, my notes, and in progress script later tonight.

--edit--
Gah, I forgot about this promise last night. I will set multiple reminders to handle it today. Sorry
 
Last edited:

StarkJohan

Newbie
Joined
Mar 27, 2015
Messages
59
I've had some success and I got to the point where I managed to add cameras but I'm still struggling with some path or access issues for the sockets and/or what I think is problems with fcgiwrap+nginx. Any help on this or useful links would be appreciated.

Edit: It's working. The problem was as silly as a path misunderstanding on my part with the Nginx cgi-bin folder setup. I also missed that some placed the fcgiwrap socket is called fcgiwrap.sock and other places it's called fcgiwrap.socket... Fixed and mjpeg now shows up in the web gui.
 
Last edited:

StarkJohan

Newbie
Joined
Mar 27, 2015
Messages
59
As my setup seems to be working I realised that there is also a port called "multimedia/zoneminder-h264".
Is this required for the rtsp h264 streams from the cameras to work?
Can I just install that port instead of "multimedia/zoneminder" or will this screw with the setup?

*Sigh*...

Edit: "portmaster -o multimedia/zoneminder-h264 multimedia/zoneminder" did the trick for "updating" to the h264 port. A few small changes to paths and config files and h264 streams seems to be working as well.
 
Last edited:

fracai

FreeNAS Guru
Joined
Aug 22, 2012
Messages
1,205
I've uploaded the installation instructions that I saved and the script that I used to start my iocage jail. The script isn't complete, but gets things going. I planned to add more commands to copy the remaining config files in to place, but haven't decided how I want to handle that part yet.
 

Attachments

StarkJohan

Newbie
Joined
Mar 27, 2015
Messages
59
Excellent! I am sure this will be very helpful to anyone trying to install zoneminder in a jail.

Now that I've got h264 passthrough MODECT event recording setup I have yet another hurdle to tackle. The events are detected just fine and the images are saved as well as the h264 mp4 file. However, the passthrough video starts way to late. I guess there simply is no "pre event buffer" to the h264 stream. Hoping to find some kind of workaround.
 
Last edited:

fracai

FreeNAS Guru
Joined
Aug 22, 2012
Messages
1,205
I turned off direct saving of the mp4 on my system. Instead I have a script which stitches the images together and uploads the video to YouTube PushBullet Flickr and sends an alert via Pushover.

That script is: https://github.com/fracai/zoneminder2flickr

I've made some changes to it that aren't included in that repo (support for multiple Pushover end points), but nothing critical.

You can configure the pre-event buffer for images to be as large as you want (and can support given your hardware) and those frames will be included in the stitched video.
 

StarkJohan

Newbie
Joined
Mar 27, 2015
Messages
59
With my 4K 20fps camera and modect or nodect zoneminder keeps dropping frames right when motion occurs when saving high quality jpegs and I prefer a "proper" video anyway. So far Mocord seems to be an OK compromise. More testing is needed but I feel like I have a fairly good grasp of the basics of zoneminder now. What I like is the absolute flexibility. With some help from filters and scripts pretty much anything is possible.

Thanks for your sharing your ideas, scripts and documents.
 
Top