Zoneminder is considered one of the leading open-source video surveillance software programs. The official website is https://zoneminder.com. You can download the latest version there and extract it by typing
You must first create a MySQL database by typing:
mariadb -u root -p < /usr/share/zoneminder/db/zm_create.sql
We check if the database is correctly created; it is simply
named zm. We then create a privileged user, zmuser, on the zm database with the password zmpass, which will obviously need to be changed.
mariadb -u root -p
Here is the result
Welcome to the MariaDB monitor. Commands end with ; or
\g.
Your MariaDB connection id is 25
Server version: 11.4.2-MariaDB Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab
and others.
Type 'help;' or '\h' for help. Type '\c' to clear the
current input statement.
MariaDB [(none)]> show databases;
+---------------------+
| Database |
+---------------------+
| MyMusic82 |
| MyMusic83 |
| MyVideos121 |
| MyVideos131 |
| digikam |
| digikam_similarites |
| digikam_vignettes |
| digikam_faces |
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
| roundcubemail |
| spamassassin |
| syncstorage_rs |
| sys |
| tokenserver_rs |
| zm |
+----------------------+
18 rows in set (0.096 sec)
MariaDB [(none)]> use mysql;
Reading table information for completion of table and
column names
You can turn off this feature to get a quicker startup
with -A
Database changed
MariaDB [mysql]> CREATE USER 'zmuser' IDENTIFIED BY
'zmpass';
Query OK, 0 rows affected (0.087 sec)
MariaDB [mysql]> GRANT ALL ON zm.* TO
'zmuser'@'localhost';
Query OK, 0 rows affected (0.201 sec)
I have now created the file /usr/lib/systemd/system/zoneminder.service which will contain
[Unit]
Description=ZoneMinder CCTV recording and security
system
After=network.target mariadb.service httpd.service
Requires=mariadb.service httpd.service
[Service]
User=apache
Type=forking
ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl reload
ExecStop=/usr/bin/zmpkg.pl stop
[Install]
WantedBy=multi-user.target
Note that the user must correspond to the owner of the Apache httpd process . The service is activated by typing
systemctl enable zoneminder
The configuration file /etc/zm/zm.conf looks like this
#
============================================================
#
# ZoneMinder Base Configuration
#
#
============================================================
#
# *** DO NOT EDIT THIS FILE ***
#
# To make custom changes to the variables below, create
a new configuration
# file, with an extension of .conf, under the
/etc/zm/conf.d
# folder, containing your desired modifications.
#
# Path to installed data directory, used mostly for
finding DB upgrade scripts
ZM_PATH_DATA=/usr/share/zoneminder
# Path to ZoneMinder binaries
ZM_PATH_BIN=/usr/bin
# Path to ZoneMinder libraries (none at present, for
future use)
ZM_PATH_LIB=/usr/lib64
# Path to ZoneMinder configuration (this file only at
present)
ZM_PATH_CONF=/etc/zm
# Path to ZoneMinder web files
ZM_PATH_WEB=/usr/share/zoneminder/www
# Path to ZoneMinder cgi files
ZM_PATH_CGI=/usr/share/zoneminder/cgi-bin
# Username and group that web daemon (httpd/apache) runs
as
# user and group owner of the apache daemon httpd
ZM_WEB_USER=apache
ZM_WEB_GROUP=apache
# ZoneMinder database type: n/a far only mysql is
supported
ZM_DB_TYPE=mysql
# ZoneMinder database hostname or ip address and
optionally port or unix socket
# Acceptable formats include hostname[:port],
ip_address[:port], or
# localhost:/path/to/unix_socket
# the name of the server on which the mariadb server is
running
ZM_DB_HOST=mariadb-serveur
# ZoneMinder database name
ZM_DB_NAME=zm
# ZoneMinder database user
ZM_DB_USER=zmuser
# ZoneMinder database password
# the password as defined in mariadb
ZM_DB_PASS=zmpass
# SSL CA certificate for ZoneMinder database
ZM_DB_SSL_CA_CERT=
# SSL client key for ZoneMinder database
ZM_DB_SSL_CLIENT_KEY=
# SSL client cert for ZoneMinder database
ZM_DB_SSL_CLIENT_CERT=
# Do NOT set ZM_SERVER_HOST if you are not using
Multi-Server
# You have been warned
#
# The name specified here must have a corresponding
entry
# in the Servers tab under Options
ZM_SERVER_HOST=
Another file, /etc/zm/conf.d/01-system-paths.conf, which will contain
#
============================================================
#
# ZoneMinder System Paths Configuration
#
#
============================================================
#
# This config file contains the variables previously
found under Options -> Paths
#
# *** DO NOT EDIT THIS FILE ***
#
# To make custom changes to the variables below, create
a new configuration
# file, with an extension of .conf, containing your
desired modifications.
#
# Full path to the folder events are recorded to.
# The web account user must have full read/write
permission to this folder.
# directory where the events are recorded
# the owner of the httpd process must be the owner, it
is apache
ZM_DIR_EVENTS=/media/motion/events
# Foldername under the webroot where ZoneMinder looks
for optional sound files
# to play when an alarm is detected.
ZM_DIR_SOUNDS=sounds
# Full path to the folder where exported archives are
stored
# The web account user must have full read/write
permission to this folder.
# directory where the archives are exported
# the apache user must own the directory
ZM_DIR_EXPORTS=/var/tmp/zm
# ZoneMinder url path to the zms streaming server
ZM_PATH_ZMS=/zm/cgi-bin/nph-zms
# Full Path to ZoneMinder's mapped memory files
# The web account user must have full read/write
permission to this folder.
ZM_PATH_MAP=/dev/shm
# Full Path to ZoneMinder's socket folder
# The web account user must have full read/write
permission to this folder.
# sockets directory
# the apache user must own it
ZM_PATH_SOCKS=/var/run/zm
# Full path to ZoneMinder's log folder
# The web account user must have full read/write
permission to this folder.
# logs directory
# the apache user must own it
ZM_PATH_LOGS=/var/log/zm
# Full path to ZoneMinder's swap folder
# The web account user must have full read/write
permission to this folder.
ZM_PATH_SWAP=/var/tmp/zm
# Full path to optional arp binary
# ZoneMinder will find the arp binary automatically on
most systems
ZM_PATH_ARP="/usr/sbin/arp"
#Full path to shutdown binary
ZM_PATH_SHUTDOWN="/sbin/shutdown"
# Path to FFmpeg binary
ZM_PATH_FFMPEG="/usr/local/bin/ffmpeg"
It will be necessary to ensure that the Apache user owns certain directories required for ZoneMinder to function.
chown -R apache:apache /var/run/zm
chown -R apache:apache /var/log/zm
chown -R apache:apache /var/lib/zoneminder
chown -R apache:apache /usr/share/zoneminder/www
chown -R apache:apache /var/cache/zoneminder
chown -R apache:apache /etc/zm
Incidentally, I created the following link
ln -s /var/cache/zoneminder/ /usr/share/zoneminder/www/cache
Next, you will need to modify the Apache httpd server configuration in the file /usr/local/apache2/conf/httpd/conf, starting with the list of useful and necessary modules.
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/
mod_access_compat.so LoadModule auth_basic_module
modules
/mod_auth_basic.so LoadModule socache_shmcb_module
modules/mod_socache_shmcb.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule filter_module modules/mod_filter.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so LoadModule
expires_module modules/mod_expires.so LoadModule
headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule unixd_module modules/mod_unixd.so LoadModule
status_module modules/ mod_status.so LoadModule
autoindex_module modules/mod_autoindex.so LoadModule
cgid_module modules/mod_cgid.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php_module modules/libphp.so
(...)
# the owner of the apache/httpd daemon
User apache
Group apache
(...)
#zoneminder specific directives
<Directory "/usr/share/zoneminder/www">
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory "/var/cache/zoneminder">
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory "/usr/share/zoneminder/cgi-bin">
Options +ExecCGI -MultiViews
+SymLinksIfOwnerMatch
AllowOverride All
Require all granted
</Directory>
<Directory "/usr/share/zoneminder/www/api">
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
RewriteBase /zm/api
</Directory>
<Directory "/usr/share/zoneminder/www/api/app">
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
RewriteBase /zm/api
</Directory>
<Directory
"/usr/share/zoneminder/www/api/app/webroot">
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteBase /zm/api
</Directory>
#alias zoneminder in this specific order
ScriptAlias /zm/cgi-bin
"/usr/share/zoneminder/cgi-bin"
Alias /zm/cache "/var/cache/zoneminder"
Alias /zm "/usr/share/zoneminder/www"
We will also ensure that the time zone variable in the /usr/local/apache2/conf/php.ini file is properly initialized.
date.timezone = Europe/Paris
We restart Apache httpd to apply the update to these last two files
systemctl httpd restart
and we launch ZoneMinder by typing
systemctl start zoneminder
and this is what the command returns
systemctl status zoneminder
● zoneminder.service - ZoneMinder CCTV recording and
security system
Loaded: loaded
(/usr/lib/systemd/system/zoneminder.service; disabled; preset:
disabled)
Active: active (running) since
Fri 2024-08-09 16:03:47 CEST; 11s ago
Process: 3570
ExecStart=/usr/bin/zmpkg.pl start (code=exited, status=0/SUCCESS)
Main PID: 3578 (zmdc.pl)
Tasks: 5 (limit: 9239)
Memory: 91.5M
CPU: 2.077s
CGroup:
/system.slice/zoneminder.service
├─3578 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
├─3606 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=1 --daemon
├─3610 /usr/bin/perl -wT /usr/bin/zmfilter.pl --filter_id=2 --daemon
├─3616 /usr/bin/perl -wT /usr/bin/zmwatch.pl
└─3620 /usr/bin/perl -wT /usr/bin/zmstats.pl
Aug 09 16:03:44 ultra.kervao.fr systemd[1]: Starting
zoneminder.service...
Aug 09 16:03:47 ultra.kervao.fr systemd[1]: Started
zoneminder.service.
We will download the latest version by typing the command
git clone https://github.com/ZoneMinder/ZoneMinder
This will create a ZoneMinder directory in which you type
mkdir build cd build git submodule update --init --recursive
At this point, we will ensure that the lib64gsoap-devel and json-devel packages are installed, then we type
cmake .. -DMYSQLCLIENT_LIBRARIES=/usr/local/mysql/lib/libmysqlclient.so -DZM_DB_HOST=mariadb-serveur -DZM_WEB_USER=apache -DZM_DIR_EVENTS=/media/motion/events -DZM_CGIDIR=/usr/share/zoneminder/cgi-bin -DCMAKE_INSTALL_PREFIX=/usr/local -DZM_CONFIG_DIR=/etc/zm -DZM_CONFIG_SUBDIR=/etc/zm/conf.d -DZM_PERL_SEARCH_PATH=/usr/share/perl5/vendor_perl -DZM_SYSTEMD=ON -DZM_WEBDIR=/usr/share/zoneminder/www
Here is the end of the result
-- Found PerlModules:
TRUE
-- Using web user: apache
-- Using web group: apache
-- Checking for one of the modules
'polkit-gobject-1;polkit'
-- Checking for module 'glib-2.0'
-- Found glib-2.0, version 2.76.3
-- Found GLIB2: /usr/lib64/libglib-2.0.so
-- Found Polkit:
/usr/lib64/libpolkit-gobject-1.so
-- Found OpenSSL: /usr/lib64/libcrypto.so (found
suitable version "3.0.15", minimum required is "1.0.1")
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
INFO Expanding CMAKE_PREFIX_PATH to include package
build dir
Building unit tests: No (default)
-- Optional libraries found: zlib cURL OpenSSL PCRE
Mosquitto Mosquittopp libVLC gsoap
-- Optional libraries not found: libVNC
-- Enabled crypto backend: openssl
-- Enabled JWT backend: jwt_cpp
-- Running ZoneMinder configuration generator
Generating
'/usr/local/linux/securite/ZoneMinder/build/zm_config_defines.h'
Updating
'/usr/local/linux/securite/ZoneMinder/build/db/zm_create.sql'
-- ZoneMinder configuration generator completed
successfully
-- Configuring done (10.4s)
-- Generating done (0.2s)
-- Build files have been written to:
/usr/local/linux/securite/ZoneMinder/build
then type make and then as root
make install
cp -Rf /root/perl5/lib/perl5/WSDiscovery11
/usr/share/perl5/vendor_perl
cp -Rf /root/perl5/lib/perl5/WSDiscovery10
/usr/share/perl5/vendor_perl
cp -Rf /root/perl5/lib/perl5/WSNotification
/usr/share/perl5/vendor_perl
cp -Rf /root/perl5/lib/perl5/ONVIF /usr/share/perl5/vendor_perl
cp -Rf /root/perl5/lib/perl5/WSNotification/
/usr/share/perl5/vendor_perl
cp -Rf /root/perl5/lib/perl5/ZoneMinder*
/usr/share/perl5/vendor_perl
cp -Rf /root/perl5/lib/perl5/WSSecurity/
/usr/share/perl5/vendor_perl
cp -Rf /root/perl5/lib/perl5/WSDiscovery
/usr/share/perl5/vendor_perl
cp -Rf /usr/share/zoneminder/cgi-bin/zms
/usr/local/apache2/cgi-bin/nph-zms
and to avoid this mistake
avril 26 17:49:33 ultra.kervao.fr zmpkg[1997204]: FAT
[Version mismatch, system is version 1.37.66, database is 1.36.35,
please run zmupdate.pl to update.]
avril 26 17:49:33 ultra.kervao.fr systemd[1]: zoneminder.service:
Control process exited, code=exited, status=255/EXCEPTION
avril 26 17:49:33 ultra.kervao.fr systemd[1]: zoneminder.service:
Failed with result 'exit-code'.
avril 26 17:49:33 ultra.kervao.fr systemd[1]: Failed to start
zoneminder.service.
We will update the ZoneMinder database by typing
/usr/local/bin/zmupdate.pl
Here is part of the result:
Initiating database upgrade to version 1.37.66 from
version 1.36.35
Do you wish to take a backup of your database prior to upgrading?
This may result in a large file in /var/tmp/zm if you have a lot
of events.
Press 'y' for a backup or 'n' to continue : y
Creating backup to /var/tmp/zm/zm-1.36.35.dump. This may take
several minutes.
mysqldump: Deprecated program name. It will be removed in a
future release, use '/usr/local/mysql/bin/mariadb-dump' instead
Database successfully backed up to /var/tmp/zm/zm-1.36.35.dump,
proceeding to upgrade.
Upgrading database to version 1.37.66
Upgrading DB to 1.37.1 from 1.36.35
mysql: Deprecated program name. It will be removed in a future
release, use '/usr/local/mysql/bin/mariadb' instead
(...)
Database successfully upgraded to version 1.37.62.
Upgrading DB to 1.37.63 from 1.36.35
mysql: Deprecated program name. It will be removed in a future
release, use '/usr/local/mysql/bin/mariadb' instead
Database successfully upgraded to version 1.37.63.
Upgrading DB to 1.37.66 from 1.36.35
mysql: Deprecated program name. It will be removed in a future
release, use '/usr/local/mysql/bin/mariadb' instead
Database successfully upgraded to version 1.37.66.
Database upgrade to version 1.37.66 successful.
Here is the main screen with a camera added using the Add Camera command with Modect mode, meaning it will detect movements and create an event for each one.

It was necessary to define the video source of the view, by setting the path
The remaining parameters must then be adjusted by trial and error. Now, upon detection of an event, the affected area(s) will be indicated.
The Event Notification Server or ZMES is a complementary tool to zoneminder ; it has machine learning which allows it to recognize objects, whether they are people or cars, for example.
The official website is https://github.com/ZoneMinder/zmeventnotification you can download the source code there and extract it by typing
tar xvfz zmeventnotification-6.1.29.tar.gz
This results in the zmeventnotification-6.1.29 directory. You can also choose to install the development version by typing
git clone https://github.com/ZoneMinder/zmeventnotification
First, we will install the packages perl-YAML-LibYAML, perl-Crypt-MySQL, perl-Module-Build-Tiny, and perl-CPAN-DistnameInfo. Then, with CPAN
perl -MCPAN -e "install Crypt::Eksblowfish::Bcrypt"
perl -MCPAN -e "install Protocol::WebSocket"
perl -MCPAN -e "install Net::WebSocket::Server"
perl -MCPAN -e "install Net::MQTT::Simple"
Here is part of the result
which: no apt-get in
(/root/perl5:/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/local/mysql/bin:/usr/lib64/qt5/bin:/usr/lib64/qt6/bin)
which: no yum in
(/root/perl5:/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/local/mysql/bin:/usr/lib64/qt5/bin:/usr/lib64/qt6/bin)
----------- Configured Values ----------------------------
Your distro seems to be ubuntu
Your webserver user seems to be apache
Your webserver group seems to be apache
wget is /usr/bin/wget
installer software is
Install Event Server: prompt
Install Event Server config: prompt
Install Hooks: prompt
Install Hooks config: prompt
Upgrade Hooks config (if applicable): yes
Download and install models (if needed): yes
The Event Server will be installed to /usr/bin
The Event Server config will be installed to /etc/zm
Hooks will be installed to /var/lib/zmeventnotification
sub-folders
Hook config files will be installed to /etc/zm
Models that will be checked/installed:
(Note, if you have already downloaded a model, it will not be
deleted)
Yolo V3 (INSTALL_YOLOV3): yes
TinyYolo V3 (INSTALL_TINYYOLOV3): yes
Yolo V4 (INSTALL_YOLOV4): yes
Tiny Yolo V4 (INSTALL_TINYYOLOV4): yes
Google Coral Edge TPU (INSTALL_CORAL_EDGETPU): no
If any of this looks wrong, please hit Ctrl+C and edit the
variables in this script...
Install Event Server Config [y/N]:y
Replacing ES config & rules file
Success:config copied
Replacing ES rules file
Success:rules copied
====> Remember to fill in the right values in the config
files, or your system won't work! <=============
Install Hook [y/N]:y
Installing pip...
install: opérande de fichier cible manquant après 'pip'
Saisissez « install --help » pour plus d'informations.
Installing python3-opencv...
install: opérande de fichier cible manquant après
'python3-opencv'
Saisissez « install --help » pour plus d'informations.
*** Installing Hooks ***
Checking for YoloV3 data files....
yolov3.cfg exists, no need to download
coco.names exists, no need to download
yolov3.weights exists, no need to download
Checking for TinyYOLOV3 data files...
yolov3-tiny.cfg exists, no need to download
coco.names exists, no need to download
yolov3-tiny.weights exists, no need to download
Checking for TinyYOLOV4 data files...
yolov4-tiny.cfg exists, no need to download
coco.names exists, no need to download
yolov4-tiny.weights exists, no need to download
Checking for YOLOV4 data files...
WARNING:Note, you need OpenCV 4.4+ for Yolov4 to work
yolov4.cfg exists, no need to download
coco.names exists, no need to download
yolov4.weights exists, no need to download
*** Installing push api plugins ***
*** Installing detection scripts ***
*** Installing user contributions ***
Copying over contrib/example.py...
Copying over contrib/ftp_selective_upload.py...
Removing old version of zmes_hook_helpers, if any
Installing new version of hooks
sudo -H pip3 -v install hook/
Using pip 23.0.1 from /usr/lib/python3.10/site-packages/pip
(python 3.10)
Processing ./hook
(...)
You will need to modify or create files under /etc/zm, first of
all secrets.ini which will contain
[secrets]
# The URL to access ZoneMinder,
https://ultra.kervao.fr/zm, needs to be adapted; the username and
password are defined on the system configuration page.
ZMES_PICTURE_URL=https://ultra.kervao.fr/zm/index.php?view=image&eid=EVENTID&fid=objdetect&width=600
ZM_USER=zm-user
ZM_PASSWORD=password
ZM_PORTAL=https://ultra.kervao.fr/zm
ZM_API_PORTAL=https://ultra.kervao.fr/zm/api
# Certificate and key for an SSL connection; I reused
those from my Apache server:
ES_CERT_FILE=/etc/ssl/public/apache.crt
ES_KEY_FILE=/etc/ssl/apache/apache.key
#Key for license plate recognition; you will need to
create an account on this website: https://platerecognizer.com/
PLATEREC_ALPR_KEY=cb5ece0dhkhg1bea8dfd08408ec6cb8370d6c3b5c
We will now modify the /etc/zm/objectconfig.ini file which will contain (excerpts)
(...)
secrets = /etc/zm/secrets.ini
# portal/user/password are needed if you plan on using
ZM's legacy
# auth mechanism to get images
# Do not modify anything; it will look in the
secrets.ini file.
portal=!ZM_PORTAL
user=!ZM_USER
password=!ZM_PASSWORD
# api portal is needed if you plan to use tokens to get
images
# requires ZM 1.33 or above
api_portal=!ZM_API_PORTAL
# This parameter must be set to yes for encrypted
connections with a self-signed certificate:
allow_self_signed=yes
(...)
# If you need basic auth to access ZM
#If the directory is password protected with a
.htaccess file, the password will be entered here.
basic_user=login-apache
basic_password=password-apache
(...)
# API/password for remote gateway
ml_user=!ML_USER
ml_password=!ML_PASSWORD
(...)
# The key for license plate recognition, same as in the
secrets.ini file:
alpr_key=cb5ece0dhkhg1bea8dfd08408ec6cb8370d6c3b5c
We now modify /etc/zm/zmeventnotification.ini
[ssl]
# Enable SSL (default: yes)
enable = yes
#same key in the secrets.ini file
cert = /etc/ssl/public/apache.crt
key = /etc/ssl/apache/apache.key
Now, in the system options and configuration, check the boxes for OPT_USE_API and OPT_USE_EVENTNOTIFICATION.
We restart ZoneMinder and launch ZMES by typing
sudo -u apache /usr/bin/zmeventnotification.pl
Here is the result
Use of uninitialized value $first_arg in string eq at
./zmeventnotification.pl line 62.
27/10/2024 17:31:03.690121
zmeventnotification[163691].INF [main:330] [Running on WebSocket
library version:0.004]
27/10/2024 17:31:07.018532
zmeventnotification[163691].INF [main:1010] [PARENT: using config
file: /etc/zm/zmeventnotification.ini]
10/27/2024 17:31:07.833499
zmeventnotification[163691].INF [main:1010] [PARENT: using secrets
file: /etc/zm/secrets.ini]
Use of uninitialized value $es_debug_level in numeric
ge (>
=) at ./zmeventnotification.pl line 999. Use of
uninitialized value $es_debug_level in numeric ge (>=) at
./zmeventnotification.pl line 999.
Use of uninitialized value $skip_monitors in split at
./zmeventnotification.pl line 543.
Use of uninitialized value $es_debug_level in numeric
ge (>=) at ./zmeventnotification.pl line 999.
Use of uninitialized value $hook_skip_monitors in
split at ./zmeventnotification.pl line 732.
with an event
27/10/2024 17:31: 26.558583
zmeventnotification[163691].INF [ main:1010] [PARENT: Push enabled via FCM] 27/10/2024
17:31:26.558734 zmeventnotification[163691].INF [main:1010]
[PARENT: MQTT Disabled]
27/10/2024
17:31:26.558814 zmeventnotification[163691].INF [main:1010]
[PARENT: |------- Starting ES version: 6.1.29 ---------|]
Can't ignore signal CHLD, forcing to default. 10/27/2024 5:31:49
PM
[main:1010] [PARENT: Re-loading monitors]
Use of uninitialized value in concatenation (.) or
string at ./zmeventnotification.pl line 1453.
10/27/2024 5:31:54.071086
zmeventnotification[163691].INF [main:1010] [PARENT: New event 380
reported for Monitor:4 (Name:Camera-4) Motion[last processed
eid:]] 27/10/2024 17:31:56.427281
zmeventnotification[163691].INF [main:1010] [PARENT:
Secure WS(WSS) is enabled...] 27/10/2024 17:31
:56.427365 zmeventnotification[163691].INF [main:1010]
[PARENT: Web Socket Event Server listening on port 9000]
To activate it as a systemd service , we will create the file /usr/lib/systemd/system/zmes.service which will contain
[Unit]
Description=ZMES
After=zoneminder.service
Requires=zoneminder.service httpd.service
[Service]
User=apache
Type=simple
ExecStart=/usr/bin/zmeventnotification.pl
Restart=on-failure
[Install]
WantedBy=multi-user.target
We will activate it by typing
systemclt enable zmes
We launch it by typing
systemctl start zmes
here is its status when you type
systemctl status zmes
● zmes.service - ZMES
Loaded: loaded
(/usr/lib/systemd/system/zmes.service; disabled; preset: disabled)
Active: active (running)
since Thu 2024-10-31 10:43:42 CET; 36s ago
Main PID: 243499 (zmeventnotifica)
Tasks: 1 (limit: 9239)
Memory: 46.3M
CPU: 784ms
CGroup:
/system.slice/zmes.service
└─243499 /usr/bin/perl -T /usr/bin/zmeventnotification.pl
Oct 31 10:43:42 ultra.kervao.fr systemd[1]: Started
zmes.service.
Oct 31 10:43:42 ultra.kervao.fr
zmeventnotification.pl[243499]: Use of uninitialized value
$first_arg in string eq at /usr/bin/zmeventnotification.pl line
61.
Oct 31 10:43:43 ultra.kervao.fr
zmeventnotification.pl[243499]: Use of uninitialized value
$es_debug_level in numeric ge (>=) at
/usr/bin/zmeventnotification.pl line 998.
Oct. 31 10:43:43 ultra.kervao.fr
zmeventnotification.pl[243499]: Use of uninitialized value
$es_debug_level in numeric ge (>=) at
/usr/bin/zmeventnotification.pl line 998.
Oct. 31 10:43:43 ultra.kervao.fr
zmeventnotification.pl[243499]: Use of uninitialized value
$skip_monitors in split at /usr/bin/zmeventnotification.pl line
542.
Oct 31 10:43:43 ultra.kervao.fr
zmeventnotification.pl[243499]: Use of uninitialized value
$es_debug_level in numeric ge (>=) at
/usr/bin/zmeventnotification.pl line 998.
Oct. 31 10:43:43 ultra.kervao.fr
zmeventnotification.pl[243499]: Use of uninitialized value
$hook_skip_monitors in split at /usr/bin/zmeventnotification.pl
line 731.
Oct. 31 10:43:44 ultra.kervao.fr
zmeventnotification.pl[243505]: Can't ignore signal CHLD, forcing
to default.
And here's what it will look like on the interface, we can see that it has identified people and a vehicle (truck).
If ZoneMinder is updated, the database may not be in the correct format, and upon launching the program, you might see a message like this:
Version mismatch, system version 1.36.35, database
version 1.36.33, please run zmupdate.pl to update.
In this case, with a MariaDB server, I first created the following links:
ln -s /usr/local/mysql/bin/mariadb-dump
/usr/local/bin/mysqldump
and
ln -s /usr/local/mysql/bin/mariadb
/usr/local/bin/mysql
Then we type
/usr/bin/zmupdate.pl
Here is the result
Initiating database upgrade to version 1.36.35 from
version 1.36.33
Do you wish to take a backup of your database prior
to upgrading?
This may result in a large file in /var/tmp/zm if
you have a lot of events.
Press 'y' for a backup or 'n' to continue: y
Creating backup to /var/tmp/zm/zm-1.36.33.dump. This
may take several minutes.
mysqldump: Deprecated program name. It will be
removed in a future release, use
'/usr/local/mysql/bin/mariadb-dump' instead
Database successfully backed up to
/var/tmp/zm/zm-1.36.33.dump, proceeding to upgrade.
Upgrading database to version 1.36.35
Upgrading DB to 1.36.34 from 1.36.33
mysql: Deprecated program name. It will be removed
in a future release, use '/usr/local/mysql/bin/mariadb' instead
Database successfully upgraded to version 1.36.34.
Database upgrade to version 1.36.35 successful.
Okay, it's finished, we can launch and use ZoneMinder again .
It is possible to access ZoneMinder from a mobile device once you have activated your LAMP server to be visible on the internet as indicated here and if possible with an encrypted connection as explained there .
The display on mobile is not great and not very user-friendly, as you can see below:
![]() |
![]() |
It turns out there's a dedicated app called zmNinja. While it does cost a modest €4.69, it's a worthwhile investment for such a small amount of money for a comfortable viewing experience on your mobile device.
First, using ZoneMinder, I made some configurations to secure access. I initially created users: a standard admin account and a limited user account.
Next, in the system settings, I enabled ZoneMinder authentication by checking the boxes below.
Then everything happens on the mobile device, where you start entering the URL and passwords.
To activate the Google Coral key with ZoneMinder, restart the zmes installation, specifying that you are using it as root.
cd
zmeventnotification-6.1.29
INSTALL_CORAL_EDGETPU=yes ./install.sh
Here is the result
which: no apt-get
in
(/root/perl5:/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/local/mysql/bin:/usr/lib64/qt5/bin:/usr/lib64/qt6/bin)
which: no yum in
(/root/perl5:/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin:/usr/local/mysql/bin:/usr/lib64/qt5/bin:/usr/lib64/qt6/bin)
----------- Configured Values
----------------------------
Your distro seems to be ubuntu
Your webserver user seems to be apache
Your webserver group seems to be apache
wget is /usr/bin/wget
installer software is
Install Event Server: prompt
Install Event Server config: prompt
Install Hooks: prompt
Install Hooks config: prompt
Upgrade Hooks config (if applicable): yes
Download and install models (if needed): yes
The Event Server will be installed to /usr/bin
The Event Server config will be installed to
/etc/zm
Hooks will be installed to
/var/lib/zmeventnotification sub-folders
Hook config files will be installed to /etc/zm
Models that will be checked/installed:
(Note, if you have already downloaded a model, it
will not be deleted)
Yolo V3 (INSTALL_YOLOV3): yes
TinyYolo V3 (INSTALL_TINYYOLOV3): yes
Yolo V4 (INSTALL_YOLOV4): yes
Tiny Yolo V4 (INSTALL_TINYYOLOV4): yes
Google Coral Edge TPU (INSTALL_CORAL_EDGETPU): no
If any of this looks wrong, please hit Ctrl+C and
edit the variables in this script...
Install Event Server [y/N]:y
*** Installing ES Dependencies ***
install libconfig-inifiles-perl
libcrypt-mysql-perl libcrypt-eksblowfish-perl
libmodule-build-perl libyaml-perl libjson-per
liblwp-protocol-https-perl libgeos-devl
install: target 'libyaml-perl': No such file or
folder
./install.sh: line 208: apt-cache: command not
found
You will have to install Net::WebSocket::Server
using cpan.
*** Installing ES ***
Success:Completed, but you will still have to
install ES dependencies as per
https://zmeventnotification.readthedocs.io/en/latest/guides/install.html#install-dependencies
Install Event Server Config [y/N]:y
Replacing ES config & rules file
Success:config copied
Replacing ES rules file
Success:rules copied
====> Remember to fill in the right values in
the config files, or your system won't work! <=============
Install Hook [y/N]:y
Installing pipe...
(...)
[object]
# Updated note: Don't use use_sequence=no. No
longer supported reliably
# If you are using legacy format
(use_sequence=no) then these parameters will
# be used during ML inferencing
object_detection_pattern=(person|car|motorbike|bus|truck|boat)
object_min_confidence=0.3
object_framework=coral_edgetpu
object_processor=tpu
object_weights={{base_data_path}}/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite
object_labels={{base_data_path}}/models/coral_edgetpu/coco_indexed.names
# Google Coral
# The mobiledet model came out in Nov 2020 and
is supposed to be faster and more accurate but YMMV
tpu_object_weights_mobiledet={{base_data_path}}/models/coral_edgetpu/ssdlite_mobiledet_coco_qat_postprocess_edgetpu.tflite
tpu_object_weights_mobilenet={{base_data_path}}/models/coral_edgetpu/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite
tpu_object_labels={{base_data_path}}/models/coral_edgetpu/coco_indexed.names
tpu_object_framework=coral_edgetpu
tpu_object_processor=tpu
tpu_min_confidence=0.6