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
chaosratt Posted April 16, 2017 Share Posted April 16, 2017 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? Quote Link to comment
dlandon Posted April 16, 2017 Author Share Posted April 16, 2017 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. Quote Link to comment
dlandon Posted April 16, 2017 Author Share Posted April 16, 2017 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. Quote Link to comment
aptalca Posted April 17, 2017 Share Posted April 17, 2017 I'm glad you're picking this up [emoji1] I'll put a link to this thread in my template thread Quote Link to comment
Stef-dk Posted April 17, 2017 Share Posted April 17, 2017 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 Quote Link to comment
dlandon Posted April 20, 2017 Author Share Posted April 20, 2017 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. Quote Link to comment
blknitro11 Posted April 22, 2017 Share Posted April 22, 2017 (edited) 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! zm-log.html Edited April 22, 2017 by blknitro11 Quote Link to comment
dlandon Posted April 22, 2017 Author Share Posted April 22, 2017 (edited) 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 April 22, 2017 by dlandon Quote Link to comment
dlandon Posted April 22, 2017 Author Share Posted April 22, 2017 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. Quote Link to comment
dlandon Posted April 22, 2017 Author Share Posted April 22, 2017 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. Quote Link to comment
dmacias Posted April 22, 2017 Share Posted April 22, 2017 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. Quote Link to comment
dlandon Posted April 23, 2017 Author Share Posted April 23, 2017 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. Quote Link to comment
dlandon Posted April 23, 2017 Author Share Posted April 23, 2017 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. Quote Link to comment
stabu Posted April 25, 2017 Share Posted April 25, 2017 I cant get export video to work. Any ideas? 1 Quote Link to comment
dlandon Posted April 25, 2017 Author Share Posted April 25, 2017 It works for me. I exported an event without issues. Quote Link to comment
dlandon Posted April 25, 2017 Author Share Posted April 25, 2017 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. Quote Link to comment
dlandon Posted May 5, 2017 Author Share Posted May 5, 2017 (edited) 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 May 5, 2017 by dlandon Quote Link to comment
dmacias Posted May 5, 2017 Share Posted May 5, 2017 Thanks. Update went fine. Everything is working great. Quote Link to comment
dlandon Posted May 5, 2017 Author Share Posted May 5, 2017 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. Quote Link to comment
dlandon Posted May 5, 2017 Author Share Posted May 5, 2017 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. Quote Link to comment
dlandon Posted May 6, 2017 Author Share Posted May 6, 2017 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. Quote Link to comment
Viaduct Posted May 6, 2017 Share Posted May 6, 2017 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. VSent from my iPhone using Tapatalk Quote Link to comment
dlandon Posted May 6, 2017 Author Share Posted May 6, 2017 As far as I know, you just configure it in the options of Zoneminder. Quote Link to comment
dlandon Posted May 6, 2017 Author Share Posted May 6, 2017 (edited) 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 May 6, 2017 by dlandon Quote Link to comment
Recommended Posts
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.