dlandon Posted April 16, 2017 Share Posted April 16, 2017 (edited) 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. You can set up multiple ports for the notification server by defining two environment variables. MULTI_PORT_START="(start port number)" and MULTI_PORT_END="(end port number)" to configure apache2 for multi-port operation. Refer to the guide here. Here is a guide on the notification server. 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: 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. Troubleshooting when the container fails If you have a situation where the container fails to start, you can set NO_START_ZM="1" as an environment variable - this will spin up the container but will not automatically start the MySql and Zoneminder processes. This way, you can get into a command line in the container (docker exec -it Zoneminder /bin/bash) and troubleshoot your issue by using the following commands to start MySql and Zoneminder and fix any errors/problems with them starting. service mysql start service zoneminder start Edited August 4, 2021 by dlandon Remove hook processing. 1 1 Quote Link to comment
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.