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

Set up storage location for zoneminder

mvcad

Member
Joined
Feb 25, 2018
Messages
93
Hi All, newbie here.
I've managed to install zoneminder plugin through Freenas web GUI, added my cameras and I can see events triggered by motion. However I have the jail in a separate SSD so I assume all video clips are getting recorded somewhere in my SSD. I have a separate volume where I would like to store the recordings from zone minder. How can I set it up?

I am using Freenas 11.2 RC2,
Hardware in my signature.

Thanks in advance
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
3,071
you need to place your storage (using iocage fstab or the new GUI) under:

/usr/local/www/zoneminder/events

and

/usr/local/www/zoneminder/images

inside the iocage jail.
 

mvcad

Member
Joined
Feb 25, 2018
Messages
93
Thanks @sretalla, Just to make sure I got you, you mean adding storage to the pool by pointing the above mentioned folders to my dataset right?

Another question, How do I set up permissions to make sure Zoneminder has access to it dataset I creaed for it?

Thanks.
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
3,071
You will run the command that looks something like this (from the FreeNAS host, but with the jail started:
iocage fstab zoneminder -a /mnt/tank/apps/zoneminder/events /usr/local/www/zoneminder/events nullfs rw 0 0
iocage fstab zoneminder -a /mnt/tank/apps/zoneminder/images /usr/local/www/zoneminder/images nullfs rw 0 0

This assumes you made the dataset/directory structure /mnt/tank/apps/zoneminder/ on your FreeNAS storage first and created the 2 directories for images and events in it.

The commands above mount those FreeNAS storage locations in your jail, ensuring the jail will write to the storage you mounted, not inside the jail itself.

You could also do this in the GUI by selecting the jail and going to mount points then from actions add mount point, but I have just seen on my 11.2 release box that it doesn't seem to work correctly, so the CLI option above is probably what you will need.

For Permissions, you can either go into your jail (iocage console zoneminder) and go to /usr/local/www/zoneminder then run chown -R root:wheel *

Otherwise you could get into a much longer story about how to get access by creating an account for zoneminder to run as, then creating that same user with the same UID on the host and assigning the permissions at the dataset level to that user... probably more trouble than you wanted.
 

mvcad

Member
Joined
Feb 25, 2018
Messages
93
Thanks, I followed your instructions, but it looks like it has some ownership conflicts. new events are not getting recorded.
I can see the mount points were created for ZM, and they point to a new dataset on a diffrent pool. The owner is root, and group is wheel. I changed the ownership as per you indications with
Code:
chown -R root:wheel *
but no luck.
this is from ZM log
1544880311259.png

1544879568334.png

Also, I noticed new events are not being numbered as before:

1544879660274.png


1544879903491.png


Any ideas?
 
Last edited:

mvcad

Member
Joined
Feb 25, 2018
Messages
93
I figured it out, I set the user and group owner to www, and all is working fine. thanks for your help!
 

yourmate

Member
Joined
Apr 4, 2016
Messages
105
I figured it out, I set the user and group owner to www, and all is working fine. thanks for your help!
Could you advise where did you set this, please?
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
3,071
Could you advise where did you set this, please?
That would be in the command line:
iocage exec zoneminder chmod -R www:www /usr/local/www/zoneminder/events
iocage exec zoneminder chmod -R www:www /usr/local/www/zoneminder/images

Assuming your jail is called zoneminder...
 

yourmate

Member
Joined
Apr 4, 2016
Messages
105
Thanks for getting back to me!

I figured a different way which seems - in my simple rookie brain at least - a better/or rather final solution in case you reinstall your box or the jail/plugin.
On the main pool, there is a "cctv" dataset which is a samba share so I can copy/review footage if I need to via my laptop. I added an ACL item on this one with user/www. Everything just works fine and the upside is that in a reinstall scenario ACL settings imported/stays with the pool so no need to setup again.
 

mvcad

Member
Joined
Feb 25, 2018
Messages
93
Could you advise where did you set this, please?
I did it through the GUI just by changing the permissions on the dataset where you are saving ZM data.
1587348132016.png
 

Frank Collins

Member
Joined
Apr 10, 2019
Messages
50
@sretalla,
I tried the change of ownership commands in post #8, modifying them to suit the current path path;
iocage exec ZoneMinder chmod -R www:www /var/db/zoneminder/events
and got this;
chmod: invalid file mode: www:www
What have I done wrong, please?
 

Basil Hendroff

Neophyte Sage
Joined
Jan 4, 2014
Messages
1,275
I think chown was intended. Try:

iocage exec ZoneMinder chown -R www:www /var/db/zoneminder/events
 

dhenzler

Member
Joined
Sep 24, 2019
Messages
41
SOLVED - The elusive files were not located where ya'll were saying. They are here... I used my old friend Midnight Commander and found them. Since I had not noticed right away that ZM was using the wrong storage... I'm moving them with MC to the big storage drive zm/files/... that way I won't have lost everything when I start up again. The next magical trick is to create two mount points. Thought about using Zoneminder on both source and destination... thought perhaps the program would sent them to the right sub folder... but alas.. I just want to get this up and running.

Good Luck to ya'll from Newport North Carolina see the screen shot.
Screenshot from 2020-05-20 14-56-30.png
 

mvcad

Member
Joined
Feb 25, 2018
Messages
93
SOLVED - The elusive files were not located where ya'll were saying. They are here... I used my old friend Midnight Commander and found them. Since I had not noticed right away that ZM was using the wrong storage... I'm moving them with MC to the big storage drive zm/files/... that way I won't have lost everything when I start up again. The next magical trick is to create two mount points. Thought about using Zoneminder on both source and destination... thought perhaps the program would sent them to the right sub folder... but alas.. I just want to get this up and running.

Good Luck to ya'll from Newport North Carolina see the screen shot. View attachment 38679
Thank you!. My drive failed and I had to re-istall ZM. if it weren't for you, I would have spent hours troubleshooting.
 

dhenzler

Member
Joined
Sep 24, 2019
Messages
41
I tried using Zoneminder, but it uses a lot of resources converting real video into motion jpg. I decided that Blue Iris ver 5.x is a better mousetrap. I run my surveillance system on a DL-380 gen7 server. I use ESXI (a thin VMWare client) and run Windows 10 for Blue Iris. Have 4 cams on it now, and it can handle many more. DL380 has 24 cores and 32G of Memory.

I discovered that the cameras can be set to do mjpg, but the user interface on Blue Iris is very nice. I was not impressed with ZM's
Screenshot from 2020-09-27 10-13-58.png
 

mvcad

Member
Joined
Feb 25, 2018
Messages
93
I tried using Zoneminder, but it uses a lot of resources converting real video into motion jpg. I decided that Blue Iris ver 5.x is a better mousetrap. I run my surveillance system on a DL-380 gen7 server. I use ESXI (a thin VMWare client) and run Windows 10 for Blue Iris. Have 4 cams on it now, and it can handle many more. DL380 has 24 cores and 32G of Memory.

I discovered that the cameras can be set to do mjpg, but the user interface on Blue Iris is very nice. I was not impressed with ZM's
View attachment 41744
Absolutely. I have been planning to upgrade my 2 core so I can run VM with Windows 10 and blue iris.
 

dhenzler

Member
Joined
Sep 24, 2019
Messages
41
Unless you just can't deal with a rackmount size server, they are a very affordable platform. Whether you choose DELL or HP they offer better cooling fantastic CPU's and Memory for a fraction of the prices that desktop machines cost. I've been using USED drives from sellers that warranty them for a year, and in some cases two years. I recently bought 14 2TB drives for under $300 with drive caddy's. I prefer HP myself. The equipment is really great.
 

Attachments

Top