Jump to content
dlandon

[support] dlandon - Zoneminder 1.32

544 posts in this topic Last Reply

Recommended Posts

This is an update of the Zoneminder Docker initially created by aptalca to the latest version of Zoneminder.  You can do an in place update of this Docker and your current configuration will be kept and the database updated.


Note: This Docker has settings pre-configured so all you have to do is install your cameras and make your particular adjustments.  Changes can be made as necessary for special needs after installation.

 

If you need help with Zoneminder click here for the documentation and here for the forum.

 

Search for Zoneminder in CA and install it.

 

The Zoneminder WebUI can be accessed by left clicking on the Zoneminder Docker and selecting WebUI.  The URL shown in the browser address bar is how you access Zoneminder.  Any changes made to the port or networking setup can change this URL.  A self signed ssl certificate is generated when the Docker starts if it does not exist and it is stored at appdata/Zoneminder/keys.  This certificate is used for https access to Zoneminder and for the zmNinja Event Notification Server.  You can supply your own certificate and replace the auto generated certificate if you'd like.  Only secure access is allowed. 

 

An update is performed on every startup of the Zoneminder Docker to keep patches and updates applied to Linux.  Zoneminder minor updates are applied automatically.  Zoneminder major updates are not applied so I can test and verify them before being applied to the Docker.  Major updates normally require changes to the Docker to work properly.

 

PTZ Control Scripts: If you have a PTZ camera that has a custom script, put it in the '/appdata/Zoneminder/control/' folder and whenever the Zoneminder docker is started, it will copy the script to the '/usr/share/perl5/ZoneMinder/Control' folder in the docker image.

 

Change Databases: You can change to an external database by overwriting the default zm.config database settings.  Change the following settings for your particular needs and put them in the file "99-mysql.conf' in the /appdata/Zoneminder/conf/ folder.  Your settings will be installed when the docker is started.

# ZoneMinder database hostname or ip address
ZM_DB_HOST=localhost

# ZoneMinder database name
ZM_DB_NAME=zm

# ZoneMinder database user
ZM_DB_USER=zmuser 

# ZoneMinder database password
ZM_DB_PASS=zmpass

 

Set up eMail Notifications: Follow the guide here.  The ssmtp configuration files are at appdata/Zoneminder/ssmtp/.

 

Note: Be sure to set up a filter for emails.

 

These changes are kept if Zoneminder is updated or removed and re-installed.

 

Set up zmNinja Event Norifications: The zmNinja Event Notification Server is included in the Docker.  The zmNinja Notification Server pushes events to your iOS and Android devices.  Enable the 'Event Server' on your iOS or Andriod device and the server will automatically connect.  Be sure to forward port 9000 on your router to the Zoneminder Docker.

 

The server is configured to run with security with the self signed certificate generated on installation of Zoneminder.  The zmNinja event server is not enabled by default.  Enable it in Options->System->OPT_USE_EVENTNOTIFICATION.  You can configure the zmnotificationserver.pl to run with or without security.  Modify the 'appdata/Zoneminder/zmeventnotification.ini' file to turn off ssl and configure other parameters like the port to listen on for events.  If you change the port, you'll need to modify the port in the docker configuration.  Restart the Docker after you've made changes to the zmeventnotification.ini file.

 

There is a 'hook' feature of zmeventnotification where processing after an event can be hooked for custom processing.  An appdata/Zoneminder/hook folder is created and the files installed that you will need for custom event processing.  The hook models can be downloaded and installed for you by setting two environment variables.  You can install either the Tiny Yolo or the Yolo models or both.

 

Set INSTALL_TINY_YOLO="1" to install the Tiny Yolo model.  Set INSTALL_YOLO="1" to install the Yolo model.

 

The hook files require additional python modules.  The Docker will load the hook modules and run 'setup.py' if you set an environment variable INSTALL_HOOK="1".  The initial install takes a long time.

 

To install the face recognition packages, set the environment variable INSTALL_FACE="1".  Don't set this unless you need face recognition.  It takes a lot of space.  The initial install takes a long time.

 

Here is a guide on the notification server.

 

Here is a guide on the hook processing.

 

crontab

 

Zoneminder has the ability to change states so you can have different operation of your cameras based on the time of day and/or day of the week.  To set up cron events, create a file called 'cron; and place it in the appdata/Zoneminnder/ folder.  The 'cron' file contents should be the crontab entries you want created.  When the Zoneminder Docker is started it will put your 'cron' file entries into the root crontab.

 

Example 'cron' file:

# Daytime camera operation
0 8 * * * /usr/bin/zmpkg.pl Daytime

# Nightime camera operation
0 20 * * * /usr/bin/zmpkg.pl Nighttime

 

Note: The default purge 'Filter' is set for 50% of the disk where the Zoneminder data is stored.  On Unraid this is not a good way to manage the growth of the events.  I recommend setting up a purge filter based on the age of the events.  This is the way to set up a filter to purge events by age:

1549064956_Purgesettings.thumb.png.dc1b14e463ae97cbc695bae558701da3.png

 

This filter purges events older than 30 days.  You can set the 'days ago' to a value that makes sense for you.

 

User Script

 

You can enable a custom user script.  Edit the docker template xml and add a variable:  ADVANCED_SCRIPT with a value of 1.  This will enable your script.

 

Put your script in the appdata/Zoneminder/ folder and name it userscript.sh.  The script will be executed each time the Docker is started before Zoneminder is started.  Be sure to chmod +x userscript.sh so the script is executable.

 

Version 1.32.x update release notes:

  • Be sure to set the display css settings.
  • The zmNinja event server is not enabled by default.  Enable it in Options->System->OPT_USE_EVENTNOTIFICATION.  You can make changes to the zmeventnotification.ini file in the appdata/config/ folder.  Restart Zoneminder after making changes.
  • You cannot change the zm.conf file in this version.  You can override the zm.conf settings by creating a '.conf' file and placing it in the apdata/config/conf/ folder.  The default zm.conf file is stored in the appdata/config/conf folder as well as a README on changing the default settings.  For example, if you want to specify your own mysql database, copy the settings from the zm.default for the database settings and place them in a new file named '99-mysql.conf' in the appdata/config/conf folder.  These settings will be used to overwrite the zm.conf default settings.  Restart the Zoneminder after making your changes.
  • You will have to redo any filter settings.
  • The config/skins directory has been removed.  The skins are not persistent across versions.
Edited by dlandon
Update of hook processing model downloads

Share this post


Link to post

Any way to disable the internal MYSQL server and use an external one if you already have a dedicated server and/or docker running for it?

Share this post


Link to post
1 hour ago, chaosratt said:

Any way to disable the internal MYSQL server and use an external one if you already have a dedicated server and/or docker running for it?

You'd have to go in the docker and change the mysql settings.  I'm no expert on mysql, so I can't say how to do it.

Share this post


Link to post

I ended up making my own docker to do some updates to the OS and add a missing package.  Wait until you see CA offer the version that is authored by me and then install it.

Share this post


Link to post

I'm glad you're picking this up I'll put a link to this thread in my template thread

Share this post


Link to post

Remeber to do this or you cant see live stream

 

On first start, open zoneminder settings, go to the paths tab and enter the following for PATH_ZMS: /zm/cgi-bin/nph-zms

Share this post


Link to post

I have updated Zoneminder to 1.30.2 and changed the Docker template to accommodate setting a version to use.  Zoneminder does not update in place, so you have to start a fresh configuration when updating.  If you want to update to the newest version read the instructions in the OP. 

 

You can stay on the current version you have installed.  The Docker manager will never show an "Update Ready" that would change versions.  Any "Update Ready" notation will update the current version you have installed.

 

Caution: Changing versions will render Zoneminder inoperative.  You have delete the Zoneminder appdata folder and start a fresh configuration.

Share this post


Link to post

Hi guys,

 

so i am using an old Android phone to test out ZM using IP Webcam app.  For some reason i can not get a picture.  I am seeing a ton of errors in the logs for m1.  I am not sure what to do to correct this.  Any help would be greatly appreciated?  I have also included screen shots of the monitor config.

 

Thanks!

Source.jpg

General.jpg

zm-log.html

Edited by blknitro11

Share this post


Link to post

It appears from the log that Zoneminder can't get the jpeg images from the phone.  Go back to the OP and verify all the settings have been made as suggested.  Be sure you have set the PATH_ZMS properly.

 

I found when setting up my cameras, it worked best to set them up as a 'Monitor' first and I had to restart Zoneminder after adding each camera.

 

Zoneminder recommends using ffmpeg for the source type.  Try using that setup.  You might also click on the link to the Zoneminder documentation and review the camera setup section.

Edited by dlandon

Share this post


Link to post
On 4/16/2017 at 11:59 AM, chaosratt said:

Any way to disable the internal MYSQL server and use an external one if you already have a dedicated server and/or docker running for it?

There is a zm.conf file in appdata/Zoneminder where the database is setup.  Look for ZM_DB_HOST=localhost.  You should be able to set that for the ip address of your mysql server.  Enter the name of your database, and there are two additional lines where you set your credentials for the database.

 

The zm.conf file will persistent and will not be removed if you update or uninstall Zoneminder.

Share this post


Link to post

The latest Zoneminder Docker has the options settings pre-configured on initial installation so they don't have to be changed after installation.  You can just start out configuring your cameras.  

Share this post


Link to post
The latest Zoneminder Docker has the options settings pre-configured on initial installation so they don't have to be changed after installation.  You can just start out configuring your cameras.  

I had some trouble with buffer overruns then monitor timeouts with the initial install. So I decided to wipe everything and reinstall. Nice not to have to reconfigure.  Thanks, all is working fine now.

 

 

Share this post


Link to post

I always thought it made sense to have those settings configured to start with.  Ended up to just be some initial database settings that are set when the Docker is built.  A lot more convenient for sure and is less prone to errors.

 

I had some trouble setting up my cameras initially.  I had to set them up as 'Monitor' and stop and start Zoneminder before they would stream video.  It seemed to be a little harder to get them going with the 1.30.2 version.

Share this post


Link to post

The updated Zoneminder docker now updates on every restart.  The updates are Linux patches and security fixes.  This will keep the docker OS up to date.

Share this post


Link to post

All of the updates to the docker are me trying to get to the goal of an in-place Zoneminder update.  I hate the idea that each new version of Zoneminder requires a complete setup from scratch.  I am working on getting the docker build script to that point.  Every time I make a change and push it to Github, a new docker is automatically built.  Zoneminder is not being updated in any of these new docker builds.

 

You can do a docker update without causing any problems.

Share this post


Link to post

I just released the docker for Zoneminder version 1.30.3.  I finally achieved an in place version update!  Version 1.30.3 of the Zoneminder docker will now update a previous Zoneminder version in place.  Just edit the docker, select the 1.30.3 repository and apply.  Your Zoneminder will update in place and your configuration will be kept.  You no longer have to start from scratch when updating Zoneminder versions.

 

Because of the ease in updating now, I encourage you to update to version 1.30.3 due to improved security.  Previous versions have security issues.

Edited by dlandon

Share this post


Link to post

Thanks for letting me know.  I'm going to rework the repository and the template to have a single version of the Zoneminder docker that will do in place updates.  Maintaining older versions is not my idea of a good time, and the security of previous versions is suspect.  People should be using the latest version.

Share this post


Link to post

I am removing all previous versions of this docker.  You will need to update by using the latest template.  I recommend you backup your appdata first.  To setup for the latest docker template:

  • Remove the Zoneminder docker container.
  • Search for the Zoneminder template in CA.
  • Install the new Zoneminder template with any changes for your particular situation.
  • Your configuration will be kept and the database updated.

I am only going to maintain this docker with the latest version of Zoneminder for the following reasons:

  • Maintaining and supporting previous versions is too much work.
  • You can't roll back versions once the database has been updated.
  • Previous versions have security issues.

Share this post


Link to post

I've removed the perl scripts from the appdata/Zoneminder folder.  These files change with each version of Zoneminder and can't be persistent between versions.  I think these scripts were exposed so users could customize the scripts.  This presents problems in updating Zoneminder because they change on each version and I'm not sure it is really a good idea to modify them.

Share this post


Link to post

Is there a how to for getting email alerts in zoneminder on unraid working?

I can't see any reference to ssmtp in the appdata folder to enter any config.

V


Sent from my iPhone using Tapatalk

Share this post


Link to post

As far as I know, you just configure it in the options of Zoneminder.

Share this post


Link to post
25 minutes ago, dlandon said:

As far as I know, you just configure it in the options of Zoneminder.

It looks like I need to install ssmtp in the docker.

 

EDIT: I'm working on updating the docker and will add ssmtp.  The ssmtp configuration files will be at appdata/Zoneminder/ssmtp.

Edited by dlandon

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.