Set up storage location for zoneminder

mvcad

Contributor
Joined
Feb 25, 2018
Messages
116
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

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
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

Contributor
Joined
Feb 25, 2018
Messages
116
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

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
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

Contributor
Joined
Feb 25, 2018
Messages
116
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

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

yourmate

Contributor
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

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
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

Contributor
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

Contributor
Joined
Feb 25, 2018
Messages
116
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

Explorer
Joined
Apr 10, 2019
Messages
53
@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?
 
Joined
Jan 4, 2014
Messages
1,644
I think chown was intended. Try:

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

dhenzler

Explorer
Joined
Sep 24, 2019
Messages
57
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

Contributor
Joined
Feb 25, 2018
Messages
116
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

Explorer
Joined
Sep 24, 2019
Messages
57
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

Contributor
Joined
Feb 25, 2018
Messages
116
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

Explorer
Joined
Sep 24, 2019
Messages
57
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

  • 20191125_211258.jpg
    20191125_211258.jpg
    144.7 KB · Views: 462
Top