selfhosted:zoneminder

Zoneminder

# install apache2
$ sudo apt-get install apache2
# update myslq
# $ sudo /etc/mysql/my.cnf  (this removes the current symbolic link)
# $ sudo cp /etc/mysql/mysql.conf.d/mysqld.cnf /etc/mysql/my.cnf
# $ sudo nano /etc/mysql/my.cnf
# </etc/mysql/my.cnf>
#   [mysqld]
#   sql_mode = NO_ENGINE_SUBSTITUTION
# $ sudo systemctl restart mysql
# add repository and install
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:iconnor/zoneminder
$ sudo apt-get update
$ sudo apt-get install zoneminder
# configure the database
$ sudo mysql -uroot -p < /usr/share/zoneminder/db/zm_create.sql
$ sudo mysql -uroot -p -e "grant select,insert,update,delete,create,alter,index,lock tables on zm.* to 'zmuser'@localhost identified by 'zmpass';"
# set permissions
$ sudo chmod 740 /etc/zm/zm.conf
$ sudo chown root:www-data /etc/zm/zm.conf
$ sudo chown -R www-data:www-data /usr/share/zoneminder/
# configure apache
$ sudo a2enconf zoneminder
$ sudo a2enmod cgi
$ sudo a2enmod rewrite
# enable and start zm
$ sudo sytemctl enable zoneminder
$ sudo sytemctl start zoneminder
# edit timezone in php
$ sudo nano /etc/php5/apache2/php.ini
</etc/php5/apache2/php.ini>
  [Date]
  date.timezone = America/Chicago
# reload apache
$ sudo systemctl reload apache2
# test zoneminder
http://localhost/zm
  • HIKVISION:
    • camera_ip: 192.168.1.64
    • source: “rtsp:username:password@192.168.1.64Streaming/Channels/1”
  • Zones > ${zone_number} > ${zone_name}
  • Choose Preset: fast, high sensitivity
  • Options > Email
    • OPT_EMAIL [+]
    • EMAIL_ADDRESS xxxx@mail.com
    • EMAIL_SUBJECT ZoneMinder: Alarm - %MN%-%EI% (%ESM% - %ESA% %EFA%)
Hello,

An alarm has been detected on your installation of the ZoneMinder.

The details are as follows :

Monitor  : %MN%
Event Id : %EI%
Length   : %EL%
Frames   : %EF% (%EFA%)
Scores   : t%EST% m%ESM% a%ESA%

This alarm was matched by the %FN% filter and can be viewed at http://192.168.35.205/zm/index.php%EPS%
  • OPT_MESSAGE [+]
  • MESSAGE_ADDRESS xxxx@mail.com
  • MESSAGE_SUBJECT ZoneMinder: Alarm - %MN%-%EI%
  • MESSAGE_BODY ZM alarm detected - %EL% secs, %EF%/%EFA% frames, t%EST%/m%ESM%/a%ESA% score.
  • NEW_MAIL_MODULES [+]
  • EMAIL_HOST localhost
  • FROM_EMAIL root@localhost
  • URL
  • SSMTP_MAIL [+]
  • SSMTP_PATH /usr/sbin/ssmtp
  • Filters:
    • Email details of all matches [+]
    • Message details of all matches [+]

PATHS:

/usr/share/zoneminder/www/events
  • selfhosted/zoneminder.txt
  • Last modified: 2023/07/03 02:32
  • by hli