Thanks to US Army Corps of Engineers ,Hydrologic Engineering Center, the ownr of HEC-RAS, HEC-HMS https://www.hec.usace.army.mil/about/ HEC-RAS & HEC-HMS The Hydraulic and hydrological simulation software developed by The U.S. Army Corps of Engineers (USACE) Hydrologic Engineering Center are freely available to the public . These software are prepared to suit the Microsoft operating systems .Since these simulation software are very useful in advance hydraulic & hydrologic engineering and water resources planning;It has to be found a method to install the same on linux platforms . I have found that the software HEC-RAS 4.1 and HEC-HMS 4.0 can be installed and run successfully on wine after adding missing dependent files mfc40.dll and THREED32.OCX . Those files can be downloaded from following links https://www.dlldump.com/download-dll-files_new.php/dllfiles/M/mfc40.dll/4.1.001/download.html https://wordpress.com/post/bkjaya.wordpress.com/2294 It is very easy to use docker images on Ubuntu as those can be used without interfering with the system setup. Therefore a docker image bkjaya1952/q4wine-x11vnc-novnc-hec has been created by me. The following software have been installed within the above image. q4wine, x11vnc, noVNC, HEC-RAS, HEC-HMS, & icecat web browser bkjaya1952/q4wine-x11vnc-novnc-hec is based on bkjaya1952/q4wine-x11vnc-novnc-hec at https://hub.docker.com/r/bkjaya1952/q4wine-x11vnc-novnc-docker Please ref:-https://hub.docker.com/r/bkjaya1952/q4wine-x11vnc-novnc-hec Usage :- To create a q4whec container (name q4whec) using bkjaya1952/q4wine-x11vnc-novnc-hec On the Ubuntu terminal sudo apt install docker.io sudo docker create -t -p 8008:8080 --name q4whec --privileged=true bkjaya1952/q4wine-x11vnc-novnc-hec sudo docker start q4whec xdg-open http://localhost:8008/vnc_lite.htmlThen the novnc desktop with q4wine will appear on the web browser at the startup. At the first run of the docker container , you will have to run the first startup wizard to configure the q4wine as follows. Right click the mouse on winecfg and run Then it will automatically download wine and install. Figure:- 1 Q4Wine desktop Figure:- 2 HEC-RAS 4.1 Figure:- 3 HEC-HMS 4.0 Figure:- 3 icecat web browser
If you want to get the novnc desktop with q4wine after closing it, please follow the following steps On the desktop, right click the mouse to get the fluxbox menu To get the q4whec desktop with q4whec panel On the menu go to sub menus and ckick Applications>Shells>Bash How to change the timezone After quitting the q4whec On the terminal enter vim /etc/timezoneThen the timezone file is opened Go to the top line of the file , press insert key on your key board and enter your timezone ( ie Asia/Colombo) Then press the( Esc key ) and ( Shift : x ) to save & quit the file The HEC-RAS , HEC-HMS and icecat web server can be started by right clicking moue and run on respective icons of Q4Wine GUI as shown first figure of above
0 Comments
SMath Studio 0.99.7030 is a tiny, powerful, free mathematical program with WYSIWYG editor and complete units of measurements support. SMath Studio has features similar to Mathcad which is a commercial software.Docker repositories are used in preset days as those can be installed easily on host machines with out interfering the default software configuration. bkjaya1952/smathstudio-docker docker repository has been created based on following software 1. SMath Studio 0.99.7030 Please refer https://en.smath.com/forum/ 2. solarkennedy/wine-x11-novnc-docker – A docker repository First I must be thankful to the following gentalman for providing their valuable resources and support to build my docker repository on Andrey Ivashov’s SMath Studio-0.99.7030 Andrey Ivashov – Owner of Studio-0.99.7030 Kyle Anderson – Owner of solarkennedy/wine-x11-novnc-docker ( I have forked his ripository to buid my repository ) Nicolas SAPA – A main contributor to solarkennedy/wine-x11-novnc-docker Usage :- To create a smath container (name smath) using bkjaya1952/smathstudio Refer:- https://hub.docker.com/r/bkjaya1952/smathstudio-docker Installation of Docker on Ubuntu 19.10 On the Ubuntu terminal sudo apt install docker.io sudo docker create -t -p 8008:8080 --name smath bkjaya1952/smathstudio-docker sudo docker start smath xdg-open http://localhost:8008 Then the desktop will appear on the web browser On the desktop, right click the mouse to get the fluxbox menu To get the SMath Studio panel On the menu go to sub menus and ckick Applications>Shells>Bash There is an enother option On The menu go to sub menus and click Applications>Programming>Monodoc(http) How to change the timezone
After quitting the ivms4200 On the terminal enter vim /etc/timezoneThen the timezone file is opened Go to the top line of the file , press insert key on your key board and enter your timezone ( ie Asia/Colombo) Then press the Esc key and (Shift :x )to save & quit the file Now, most of the people prefer to use Linux operating systems on personal computers as those are opensource freeware with less risk for virus attacks. But some software developers make their software to promote Windows platforms according to a commercial agenda. Most of the Hikvision camera configuration software are designed for Windows platforms. There is only one ivms4200- Linux built in the past . But this Linux version is not known to most of the people . Best thing is to use docker repositories , as those do not have dependency problems or clash with the operating systems of host machine. Therefore , I have created a docker repository bkjaya1952/docker-ivms4200-linux using solarkennedy / wine-x11-novnc-docker as the base and uploaded to the dockerhub This image has been created based on repository solarkennedy/wine-x11-novnc-docker . This repository bkjaya1952/docker-ivms4200-linux can be used in Linux platforms to configure Hikvision IP Cameras easily. First I must be thankful to Kyle Anderson for providing us a very useful repository solarkennedy/wine-x11-novnc-docker. Nicolas SAPA, a main contributor of solarkennedy/wine-x11-novnc-docker , helped me by making some changes in solarkennedy/wine-x11-novnc-docker , to facilitate in running my app successfully. Usage :- To create a ivms container (name ivms) using bkjaya1952/docker-ivms4200-linux Refer:- https://hub.docker.com/r/bkjaya1952/docker-ivms4200-linux On the Ubuntu terminal sudo apt install docker.io sudo docker create -t -p 8008:8080 --name ivms bkjaya1952/docker-ivms4200-linux sudo docker start ivms xdg-open http://localhost:8008Then the desktop will appear on the web browser On the desktop, right click the mouse to get the fluxbox menu On the menu go to sub menus and ckick Applications>Shells>Bash Now the configuration panel of ivms4200 will appear so that you can add your Hikvision cameras. How to change the timezone
After quitting the ivms4200 On the terminal enter vim /etc/timezoneThen the timezone file is opened Go to the top line of the file , press insert key on your key board and enter your timezone ( ie Asia/Colombo) Then press the Esc key and Shift :x to save & quit the file Note:- Please refer the following link to see the details of docker build https://github.com/bkjaya2020/docker-ivms4200-linux At the moment PHP mysqli connector does not have support for caching_sha2_password. We will have to use mysql_native_password until the PHP 7.4 is revised to support caching_sha2_password. Installation of php 7.4 sudo su apt install -y software-properties-common add-apt-repository ppa:ondrej/php apt update apt -y install php7.4 Installation of Zoneminder To install Zoneminder Please refer Connor’s web site sudo add-apt-repository ppa:iconnor/zoneminder-master apt update apt install zoneminder rm /etc/mysql/my.cnf cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf sed -i "15i default_authentication_plugin= mysql_native_password" /etc/mysql/my.cnf /etc/init.d/mysql start mysql CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass'; GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES ; quit mysqladmin -uroot -p reload chmod 740 /etc/zm/zm.conf chown root:www-data /etc/zm/zm.conf adduser www-data video a2enmod cgi a2enconf zoneminder a2enmod rewrite chown -R www-data:www-data /usr/share/zoneminder/ systemctl enable zoneminder service zoneminder start service apache2 reload Open zoneminder web console (http://localhost/zm/) Note:-If you want to install docker-zonemider ,please refer the following link bkjaya1952/docker-zoneminder-master-php7.4-mysql8 Add timezone to PHP (Otherwise there will be an error message in logs) gedit /etc/php/7.4/apache2/php.ini Figure:- 1 addng date.timezone in php.ini
Then save the file php.ini Your time zone can be get from here <code>Today, Mr. Isaac Connor has published the first successful Zoneminder-master-eoan package for Ubuntu 19.10. in his website . To avoid errors when installing Zoneminder , MySQL-server is installed first. Installation of MySQL-server On the Ubuntu terminal sudo su apt install mysql-server rm /etc/mysql/my.cnf cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf sed -i "15i default_authentication_plugin= mysql_native_password" /etc/mysql/my.cnf /etc/init.d/mysql start Installation of Zoneminder To install Zoneminder Please refer Connor’s web site Open the terminal and run following commands. mysql CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass'; GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES ; quit mysqladmin -uroot -p reload sudo add-apt-repository ppa:iconnor/zoneminder-master sudo apt-get update sudo apt install zoneminder mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql mysqladmin -uroot -p reload chmod 740 /etc/zm/zm.conf chown root:www-data /etc/zm/zm.conf adduser www-data video a2enmod cgi a2enconf zoneminder a2enmod rewrite chown -R www-data:www-data /usr/share/zoneminder/ systemctl enable zoneminder service zoneminder start service apache2 reload Open zoneminder web console (http://localhost/zm/) Figure :- Montage of 2 cameras after adding USB Cam & IP Cam
You can see the USB camera and a Hikvision IP camera are working in the above figure Note:- If you fail and get an error ( ERROR 1396 (HY000)) ,when creating mysql user with “CREATE USER” , that means there is already a user. In that case please replace it with “ALTER USER” . If you get “MySQL: “Access denied for user ‘debian-sys-maint’@’localhost’”” when updating zoneminder , you can correct it by making following changes. On the Ubuntu terminal sudo gedit /etc/mysql/debian.cnf Then you can see the automatically generated debian password for mysql as follows in the opened “debian.cnf” file ( In your case , you may get a different password) # Automatically generated for Debian scripts. DO NOT TOUCH! [client] host = localhost user = debian-sys-maint password = s4bSHUP05s1J32G5 socket = /var/run/mysqld/mysqld.sock [mysql_upgrade] host = localhost user = debian-sys-maint password = s4bSHUP05s1J32G5 socket = /var/run/mysqld/mysqld.sock Now you will have to grant permissions to ‘debian-sys-maint’@’localhost’” as follows ALTER USER 'debian-sys-maint'@localhost IDENTIFIED WITH mysql_native_password BY 's4abSHUP05s1J32G5'; GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' WITH GRANT OPTION; quit sudo /etc/init.d/mysql restart In this tutorial ,we are going to use “Docker: Enterprise Container Platform” (docker.io) on Ubuntu 19.10. As , still there is on official zoneminder issued for Ubuntu 19.10 due dependency issues, the best option is to use docker Zoneminder to overcome dependency problems and to avoid conflicts with the default setup of Ubuntu 19.10 First Installation of Docker on Ubuntu 19.10 On the Ubuntu terminal sudo apt install docker.io Then use , https://hub.docker.com/r/bkjaya1952/zoneminder-master-docker-latest Docker Repository to make a container . ( This image has been created on ubuntu:eoan with zoneminder-master/ubuntu-20.04) hub.docker.com/r/bkjaya1952/zoneminder-master-docker-latest I have created the above docker image and pushed to the Docker Hub. Figure:- bkjaya1952/zoneminder-master-docker-latest Repository at dockerhub sudo docker create -t -p 8080:80 --shm-size=4096m --name zm --privileged=true bkjaya1952/zoneminder-master-docker-latest sudo docker start zm You will have to configure the running zm container for mysql 8 ,zm data base and make some changes to start apache and zoneminder during the first run . sudo docker exec -t -i zm /bin/bash Now you will be with in the zm container. Make changes as follows /etc/init.d/mysql start chown -R www-data:www-data /var/run/zm sed -i "228i ServerName localhost" /etc/apache2/apache2.conf (Making an empty root password) mysql CREATE USER 'admin'@'localhost' IDENTIFIED WITH mysql_native_password BY ''; GRANT ALL PRIVILEGES ON . TO 'admin'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES ; quit mysqladmin -uroot -p reload service apache2 start service apache2 reload exit (As the apache service and zoneminder do not in running condition , when the zm container is started , we will have to edit the file "/etc/bash.bashrc" . For editing , the "bash.bashrc" file is copied to the host and copied back to the container "zm" after making changes as follows. You will have to make these changes at the first time running only. ) (Open the Ubuntu terminal at the host) sudo docker cp zm:/etc/bash.bashrc ~/Downloads ( Here i have copied the file to the Downloads folder of the computer) (If go the Downloads folder, you can see the copied "bash.bashrc" file) (In order to make changes to "bash.bashrc") sudo chmod -R 777 ~/Downloads/bash.bashrc sudo gedit ~/Downloads/bash.bashrc (Now enter the following two lines at the bottom of the opened “bash.bashrc” file and save.) /etc/init.d/apache2 start /usr/bin/zmpkg.pl start Figure:- Edited “bash.bashrc” file (To copy back the edited “bash.bashrc” to /etc/ of the container “zm” , run the following command on the terminal) sudo docker cp ~/Downloads/bash.bashrc zm:/etc/ (Now you can restart the container to see whether the zoneminder is active as follows) sudo docker restart zm http://localhost:8080/zm/ Figure:- ZM-Console after adding IP Cam & USB Cam Starting & stopping of the docker container “zm” and zoneminder can be done using script files as follows.Those script files are created using the text editor and saved in Document directory. Starting process consists of two script files , namely zmdockerstart.sh and zmdostart.sh . When the zmdostart.sh is executed , it redirects to the core file zmdockerstart.sh , which is having scripts to start ” zm ” container , and to start services apache and zoneninder. The command “docker exec -t -i am /bin/bash” starts the services apache aand zoneminder . Note:- The script file “zmdockerstart.sh” alone can’t start services apache and zoneninder. Therefore, an additional redirecting script file “zmdostart.sh” has to introduced. Figure:-2 Starting script files zmdockerstart.sh & zmdostart.sh Stopping script Figure:-3 Stopping script file zmdockerstop.sh Making files executable sudo chmod +x ~/Documents/zmdockerstart.sh sudo chmod +x ~/Documents/ zmdockerstop.sh sudo chmod +x ~/Documents/ zmdostart.sh The sudo privileges have given to the above files using “sudo visudo ” on the Ubuntu terminal and adding the files in /etc/sudoers file as follows sudo visudo Figure:-4 Adding script file paths to /etc/sudoers.tmp ( to give sudo privileges to script files Figure:-5 Stater buttons are created on the dock using Manmenu software Figure:-6 Start & Stop buttons on the Dock (Note:- Each time , you start the container ,you will have to run ” sudo docker exec -t -i zm /bin/bash” after “sudo docker start zm” to get the ZM Console) (To use msmtp for emailing please refer https://hub.docker.com/repository/docker/bkjaya1952/docker-zoneminder-master) The details on composing the image can be get from the the following link How to Build a Zoneminder-master Docker-Image with MYSQL 8 & MSMTP How to uninstall the setup How to uninstall the Docker container:- On the Ubuntu terminal sudo docker rm zm How to uninstall the Repository :- sudo docker rmi bkjaya1952/docker-zoneminder-master-mysql8:1.33.16 How to install Zoneminder-master- Docker , v1.33.16 with MSMTP on Ubuntu 19.10 (Eoan Ermine)1/12/2020 n this tutorial ,we are going to use “Docker: Enterprise Container Platform” (docker.io) on Ubuntu 19.10.As , still there is on official zoneminder issued for Ubuntu 19.10 due dependency issues, the best option is to use docker Zoneminder to overcome dependency problems and to avoid conflicts with the default setup of Ubuntu 19.10 First Installation of Docker on Ubuntu 19.10 On the Ubuntu terminal sudo apt install docker.io Then use , bkjaya1952/docker-zoneminder-master Docker Repository to make a container . ( This image has been created on Ubuntu 19.04 disco ) sudo docker create -t -p 8085:80 --shm-size=4096m -e TZ=Asia/Colombo --name myzm --privileged=true bkjaya1952/docker-zoneminder-master:v1.33.16. Note :- use your timezone instead of "TZ=Asia/Colombo" sudo docker start myzm For configuring MSMTP for emailing zoneminder motion detection events, please refer the following link. https://hub.docker.com/r/bkjaya1952/docker-zoneminder-master Open http://localhost:8085/zm/ and add the camera monitors And fill up email details under the Optons/email of the ZM-Panel Create appropriate zm-filter to send email alerts of motion detection events Figure:- 1 After adding Camera monitors to ZM The scripts of the Dockerfile are as shown in the following figure Figure:-2 The scripts of the Dockerfile
To download the Dockerfile https://www.dropbox.com/s/737qnv3144b52bi/Dockerfile?dl=0 To download the entrypoint.sh https://www.dropbox.com/s/m5lgf2d196a4f5s/entrypoint.sh?dl=0 Please refer my following blog to know about the building an image and pushing to the Docker Hub https://bkjaya.wordpress.com/2019/12/20/how-to-build-a-zoneminder-docker-image-with-msmtp-using-a-dockerfile-push-to-docker-hub-ubuntu-19-10/ Acknowledgements : Based on Zoneminder and Andrew Bauer’s [email protected] entrypoint script Since the official Zoneminder eoan has Dependency wait on lgw01-amd64-051 , We will have to install Zoneminder disco on Ubuntu 19.10. There is a problem in the present PHP release which make errors with the “caching_sha2_password” introduced in the Mysql 8 by default . Please refer the following link https://www.php.net/manual/en/mysqli.requirements.php Therefore , we will have to use “mysql_native_password” method in Mysql 8. First of all we will have to install mysql-server-8 on Ubuntu 19.10 and enable mysql_native_password The installation of mysql-server-8.0 can be done using the synaptic package manager . Figure:-1 Installed mysql-server-8 shown in synaptic package manager Then open the Ubuntu terminal sudo su rm /etc/mysql/my.cnf cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf Then you will have to enter the following line below [mysqld] ( line no 15 ) in my.cnf file default_authentication_plugin= mysql_native_password On the Ubuntu terminal sudo su sed -i "15i default_authentication_plugin= mysql_native_password" /etc/mysql/my.cnf systemctl restart mysql Then enter the following commands on the terminal to set root password for mysql server mysql CREATE USER 'admin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your password'; GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES ; quit systemctl restart mysql Then install Zoneminder The Zoneminder disco deb file is downloaded from https://launchpad.net/~iconnor/+archive/ubuntu/zoneminder-master/+build/18492553/+files/zoneminder_1.33.16~20191229135312-disco_amd64.deb GDebi Package Installer can be used to install the Zoneminder disco deb file Before installing Zoneminder disco deb file to overcome dependency issues we will have to download libmysqlclient20and install first using the GDebi Package Installer. Then install Zoneminder disco deb file that we have downloaded . Creating user and zmpass Open the Ubuntu terminal and enter following 5 commands sudo su mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql mysql CREATE USER 'zmuser'@localhost IDENTIFIED WITH mysql_native_password BY 'zmpass'; GRANT ALL PRIVILEGES ON zm.* TO 'zmuser'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES ; quit mysqladmin -uroot -p reload It was observed that there are missing *.ini files in /etc/php/7.3/mods-available/ which will make problems in getting zoneminder Console. Therefore the necessary files have to be copied from /usr/share/php7.3-mysql/mysql sudo cp /usr/share/php7.3-mysql/mysql/*.ini /etc/php/7.3/mods-available/ sudo service apache2 reload Figure:- 2 & 3 files in foler /usr/share/php7.3-mysql/mysql/ and /usr/share/php7.3-mysql/mysql/ after coping ini files chmod 740 /etc/zm/zm.conf chown root:www-data /etc/zm/zm.conf adduser www-data video a2enmod cgi a2enconf zoneminder a2enmod rewrite chown -R www-data:www-data /usr/share/zoneminder/ systemctl enable zoneminder service zoneminder start Figure:-4 Zoneminder Console , after adding an Usb camera
(Note :- In order to have clean mysql-server-8.0 install , it is better to completely delete exiting mysql as follows sudo apt remove --purge mysql-server mysql-client mysql-common sudo apt autoremove sudo apt autoclean sudo rm -rf /etc/mysql ) In this tutorial ,we are going to use “Docker: Enterprise Container Platform” (docker.io) on Ubuntu 19.10.First Installation of Docker on Ubuntu 19.10 On the Ubuntu terminal sudo apt install docker.io Then a zoneminder-docker image is built using a Dockerfile and entrypoint.sh Dockerfile contains the scripts to install free open-source software Zoneminder and entrypoint.sh has necessary commands to start Zoneminder ,Apache and other services and to keep the docker container running. I have used my own Dockerfile and entrypoint.sh prepared by Andrew Bauer The scripts in the Docker file are as shown in the following figure:- 1 Figure:- 1 Scripts in the Dockerfile For the purpose of building the zoneminder- docker image the files Dockerfile and entrypoint.sh are saved on the Documents folder of the computer as shown in the following figure:- 2. figure:- 2 Dockerfile and entrypoint.sh marked in green color saved in the Documents folder The Dockerfile and entrypoint.sh can be downloaded from this links Dockerfile entrypoint.sh Building the Zoneminder-Docker image ( tagged as “yourzoneminder”) Open the Ubuntu terminal cd ~/Documents sudo docker build --tag=yourzoneminder . # Dockerfile ( The process will take about 10-15 minutes) After the image building process is finished ,you find the image by runng sudo docker images For the purpose of identifying the image in the Docker Hub , you will have to tag it with an appropriate name . In our case ,I have name as “bkjaya1952/docker-zoneminder:v1.32.3.” sudo docker tag yourzoneminder bkjaya1952/docker-zoneminder:v1.32.3. Then push the tagged image to the Docker Hub sudo docker login Note : first you will have to signup & open a Docker Hub account at https://hub.docker.com/ sudo docker push bkjaya1952/docker-zoneminder:v1.32.3. Figure:- 3 Tagging and pushing the image to the Docker Hub Now you can see my pushed image at https://hub.docker.com/repository/docker/bkjaya1952/docker-zoneminder Figure:- 4 Pushed image at the Docker Hub The instructions to use the image has been entered at the Docker Hub, after the pushing is completed . Usage of the pushed image bkjaya1952/docker-zoneminder sudo docker create -t -p 8085:80 --shm-size=4096m -e TZ=Asia/Colombo --name myzm --privileged=true bkjaya1952/docker-zoneminder:v1.32.3. Note :- use your timezone instead of "TZ=Asia/Colombo" sudo docker start myzm Configuring MSMTP for emailing zoneminder motion detection events Make the following file in the home folder of your computer and copy in to the zm container that you have created by above mentioned commands Open the Ubuntu terminal and run sudo gedit msmtprc # Set default values for all following accounts. defaults auth on tls on tls_trust_file /etc/ssl/certs/ca-certificates.crt logfile ~/.msmtp.log # Gmail account gmail host smtp.gmail.com port 587 from youer gmail address user youer gmail address password your gmail password # Set a default account account default : gmail Then copy the created msmtpru file to the folder /etc/ of the zm container as follows sudo docker cp msmtprc myzm:/etc/msmtprcOpen http://localhost:8085/zm/ and add the camera monitors Figure:- 5 Added USB camera to Zoneminder And fill up email details under the Optons/email of the ZM-Panel Create appropriate zm-filter to send email alerts of motion detection events For entering e mail details and creating zm-filter please refer my following blog ( After the Figure:- 3 in the blog) How to install Zoneminder 1.32 (with MSMTP email support ) in Docker on Ubuntu 19.10 Figure:- 5 Received motion detection email alerts from Zoneminder
Acknowledgements : Based on Isaac Connor’s Zoneminder and Andrew Bauer’s [email protected] entrypoint script at https://raw.githubusercontent.com/ZoneMinder/zmdockerfiles/master/utils/entrypoint.sh How to use ssmtp mail transfer agent within a docker-zoneminder container on UIbuntu 19.1011/26/2019 In this tutorial we are going to use “Docker: Enterprise Container Platform” (docker.io) to install “quantumobject/docker-zoneminder” on Ubuntu 18.10 operating system. Then SSMTP (MTA) is installed within the Zoneminder container created using quantumobject/docker-zoneminder . The “quantumobject/docker-zoneminder which is based on zoneminder master packages has been maintained and uploaded to the Docker Hub by Angel Rodriguez-Rodiguez-Riccrdo. Installation procedure is given below. Installation of Docker on Ubuntu 19.10 Open the Ubuntu terminal and run sudo apt install docker.io We are going to run Zoneminder with MySQL in a separate container On the Ubuntu terminal sudo docker network create net ( I have used my timezone as Asia/Colombo . Your time zone can be get from here )The above commands will pull mysql/mysql-server:5.7 and create a container named “db” on the Docker Platform Then on the Ubuntu terminal sudo docker run -d -e TZ=Asia/Colombo -e MYSQL_USER=zmuser -e MYSQL_PASSWORD=zmpass -e MYSQL_DATABASE=zm -e MYSQL_ROOT_PASSWORD=mysqlpsswd -e MYSQL_ROOT_HOST=% --net net --name db mysql/mysql-server:5.7 The above commands will pull mysql/mysql-server:5.7 from docker hub and create a container named "db" sudo docker run -d --shm-size=4096m -e TZ=Asia/Colombo -e ZM_DB_HOST=db --net net --name zm -p 8085:80 --privileged=true quantumobject/docker-zoneminder The above commands will pull quantumobject/docker-zoneminder from the Docker Hub and create a container named “zm” (Here ,I have used port 8085 for the ZM panal ) ( You can notice “- -device=/dev/video0:/dev/video0” in above command which facilitate adding USB cameras on Zoneminder/Docker . You can use “- -privileged=true” also instead of “- -device=/dev/video0:/dev/video0”) In order to appear ZM panel , you will have to start above two containers “db” and “zm” using the terminal as follows. sudo docker start db zm Then open the web browser http://localhost:8085/zm/ Figure:- 1 zm console with USB camera Installation of SSMTP on ZM container Open the Ubuntu terminal and run sudo docker exec -t -i zm /bin/bash Then the following prompt will apear root@79ae35734aea:/# Now you are inside the ZM container Then enter following commands to install SSMTP within the ZM container apt update apt install ssmtp Now the SSMTP is installed wihin the ZM container. If you go to /etc/ssmtp/ you can see two ssmtp configuration files namely ssmtp.conf and revaliases You will have to edit above files to suit your email requirements . As the editing the files within the container is difficult, ssmtp.conf and revaliases are created wihin the host and copy in to the container . Let us create ssmtp.conf and revaliases files at the home folder of host Go to the home directory of the host and open the Ubuntu terminal sudo gedit ssmtp.conf Then enter the following scripts in the opened file and save root=youer [email protected] mailhub=smtp.gmail.com:587 hostname=localhost RewriteDomain=gmail.com UseSTARTTLS=YES UseTLS=YES AuthUser=youer [email protected] AuthPass=Your gmail password ---------------------------------------------------------------------------------------------------------------------- sudo gedit revaliases Then enter the following scripts in the opened file and save root:youer [email protected]:smtp.gmail.com:587 www-data:youer [email protected]:smtp.gmail.com:587 ---------------------------------------------------------------------------------------------------------------------- Now you will have to copy two files ssmtp.conf and revaliases in to the folder /etc/ssmtp/ of the ZM container using following commands on the Ubuntu terminal sudo docker cp ssmtp.conf zm:/etc/ssmtp/ssmtp.conf sudo docker cp revaliases zm:/etc/ssmtp/revaliases Now ZM container is ready for sending emails from localhost/zm Then the Email details have to be entered and save at ZM-Options/Email as shown in the following figure. Figure:- 2 Scripts in ssmtp.conf and revaliases files Figure:- 3 Entering email detalis The a ZM filter has to be created as shown in the following figure and execute to be able to send emails alerts to your email address. Figure:- 4 Filter created for sending email alaerts Figure:- 5 Email alerts on motion detection on Aol mail |
AuthorRetired Director of Irrigation ,Sri Lanka Categories
All
Archives
March 2020
|