• カテゴリー別アーカイブ 長期運用TIPS
  • 長期運用するにあたってのTIPS

  • zoneminder » 長期運用TIPS
  • ZoneMinder新規インストール時に「ZoneMinder – Privacy」から先に進まない件

    サーバ入れ替えに伴い、ZoneMinderを新規インストールしました。その際に「ZoneMinder – Privacy」でAPPLYを押してもエンドレスループしました。

    エンドレスループした画面は以下。

    その際に出ていたApacheログは以下。

    [Sun Feb 21 20:53:02.940049 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_DATABASE - assumed 'ZM_LOG_LEVEL_DATABASE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 102
    [Sun Feb 21 20:53:02.940090 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_FILE - assumed 'ZM_LOG_LEVEL_FILE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 107
    [Sun Feb 21 20:53:02.940101 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG - assumed 'ZM_LOG_DEBUG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 136
    [Sun Feb 21 20:53:02.940107 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG_TARGET - assumed 'ZM_LOG_DEBUG_TARGET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 137
    [Sun Feb 21 20:53:02.940198 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_DATABASE - assumed 'ZM_LOG_LEVEL_DATABASE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 102
    [Sun Feb 21 20:53:02.940210 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_FILE - assumed 'ZM_LOG_LEVEL_FILE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 107
    [Sun Feb 21 20:53:02.940216 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_WEBLOG - assumed 'ZM_LOG_LEVEL_WEBLOG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 112
    [Sun Feb 21 20:53:02.940219 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_SYSLOG - assumed 'ZM_LOG_LEVEL_SYSLOG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 117
    [Sun Feb 21 20:53:02.940237 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG - assumed 'ZM_LOG_DEBUG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 136
    [Sun Feb 21 20:53:02.940244 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG_TARGET - assumed 'ZM_LOG_DEBUG_TARGET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 137
    [Sun Feb 21 20:53:02.940631 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_COOKIE_LIFETIME - assumed 'ZM_COOKIE_LIFETIME' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/session.php on line 11
    [Sun Feb 21 20:53:02.940808 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_COOKIE_LIFETIME - assumed 'ZM_COOKIE_LIFETIME' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/session.php on line 39
    [Sun Feb 21 20:53:02.940818 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  A non-numeric value encountered in /usr/share/zoneminder/www/includes/session.php on line 39
    [Sun Feb 21 20:53:02.940823 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_COOKIE_LIFETIME - assumed 'ZM_COOKIE_LIFETIME' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/session.php on line 40
    [Sun Feb 21 20:53:02.940826 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_COOKIE_LIFETIME - assumed 'ZM_COOKIE_LIFETIME' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/session.php on line 40
    [Sun Feb 21 20:53:02.940830 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  A non-numeric value encountered in /usr/share/zoneminder/www/includes/session.php on line 40
    [Sun Feb 21 20:53:02.945388 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_OPT_USE_AUTH - assumed 'ZM_OPT_USE_AUTH' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 296
    [Sun Feb 21 20:53:02.945410 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_LOGINS - assumed 'ZM_AUTH_HASH_LOGINS' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 306
    [Sun Feb 21 20:53:02.945415 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_TYPE - assumed 'ZM_AUTH_TYPE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 321
    [Sun Feb 21 20:53:02.945420 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_LOGINS - assumed 'ZM_AUTH_HASH_LOGINS' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 264
    [Sun Feb 21 20:53:02.945423 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 264
    [Sun Feb 21 20:53:02.945696 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_IPS - assumed 'ZM_AUTH_HASH_IPS' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 331
    [Sun Feb 21 20:53:02.945715 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_OPT_USE_AUTH - assumed 'ZM_OPT_USE_AUTH' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 216
    [Sun Feb 21 20:53:02.945726 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 216
    [Sun Feb 21 20:53:02.947984 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LANG_DEFAULT - assumed 'ZM_LANG_DEFAULT' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/lang.php on line 46
    [Sun Feb 21 20:53:02.952628 2021] [php7:notice] [pid 279548] [client 192.168.0.240:62176] WAR [System language file lang/ZM_LANG_DEFAULT.php does not exist.]
    [Sun Feb 21 20:53:02.952719 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_BANDWIDTH_DEFAULT - assumed 'ZM_BANDWIDTH_DEFAULT' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/skins/classic/skin.php on line 22
    [Sun Feb 21 20:53:02.952765 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_ENABLE_CSRF_MAGIC - assumed 'ZM_ENABLE_CSRF_MAGIC' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/index.php on line 226
    [Sun Feb 21 20:53:02.952777 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_SECRET - assumed 'ZM_AUTH_HASH_SECRET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/csrf/csrf-magic.php on line 55
    [Sun Feb 21 20:53:02.952783 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_SECRET - assumed 'ZM_AUTH_HASH_SECRET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/csrf/csrf-magic.php on line 105
    [Sun Feb 21 20:53:02.952796 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_OPT_USE_AUTH - assumed 'ZM_OPT_USE_AUTH' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/index.php on line 251
    [Sun Feb 21 20:53:02.952804 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_SHOW_PRIVACY - assumed 'ZM_SHOW_PRIVACY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/index.php on line 267
    [Sun Feb 21 20:53:02.952858 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_WEB_TITLE_PREFIX - assumed 'ZM_WEB_TITLE_PREFIX' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/skins/classic/includes/functions.php on line 97
    [Sun Feb 21 20:53:02.952984 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_TELEMETRY_DATA - assumed 'ZM_TELEMETRY_DATA' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/skins/classic/views/privacy.php on line 66
    [Sun Feb 21 20:53:02.955589 2021] [php7:notice] [pid 279548] [client 192.168.0.240:62176] WAR [Specified value ZM_TELEMETRY_DATA not in contents: Array\n(\n    [1] => Accept\n    [0] => Decline\n)]
    [Sun Feb 21 20:53:02.955726 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_WEB_AJAX_TIMEOUT - assumed 'ZM_WEB_AJAX_TIMEOUT' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/skins/classic/js/skin.js.php on line 27
    [Sun Feb 21 20:53:02.955735 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_WEB_REFRESH_NAVBAR - assumed 'ZM_WEB_REFRESH_NAVBAR' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/skins/classic/js/skin.js.php on line 28
    [Sun Feb 21 20:53:02.955739 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  A non-numeric value encountered in /usr/share/zoneminder/www/skins/classic/js/skin.js.php on line 28
    [Sun Feb 21 20:53:02.955803 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_WEB_ANIMATE_THUMBS - assumed 'ZM_WEB_ANIMATE_THUMBS' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/skins/classic/js/skin.js.php on line 55
    [Sun Feb 21 20:53:02.955815 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_IPS - assumed 'ZM_AUTH_HASH_IPS' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/skins/classic/js/skin.js.php on line 83
    [Sun Feb 21 20:53:02.955820 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_OPT_USE_AUTH - assumed 'ZM_OPT_USE_AUTH' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 216
    [Sun Feb 21 20:53:02.955823 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 216
    [Sun Feb 21 20:53:02.955828 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_OPT_USE_AUTH - assumed 'ZM_OPT_USE_AUTH' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 281
    [Sun Feb 21 20:53:02.955832 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 282
    [Sun Feb 21 20:53:02.955835 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 284
    [Sun Feb 21 20:53:02.955838 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 287
    [Sun Feb 21 20:53:02.955842 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 290
    [Sun Feb 21 20:53:02.958641 2021] [php7:notice] [pid 279548] [client 192.168.0.240:62176] ERR [Unknown value for ZM_AUTH_RELAY ZM_AUTH_RELAY]
    [Sun Feb 21 20:53:03.297556 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_DATABASE - assumed 'ZM_LOG_LEVEL_DATABASE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 102, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297584 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_FILE - assumed 'ZM_LOG_LEVEL_FILE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 107, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297592 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG - assumed 'ZM_LOG_DEBUG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 136, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297595 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG_TARGET - assumed 'ZM_LOG_DEBUG_TARGET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 137, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297647 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_DATABASE - assumed 'ZM_LOG_LEVEL_DATABASE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 102, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297655 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_FILE - assumed 'ZM_LOG_LEVEL_FILE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 107, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297659 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_WEBLOG - assumed 'ZM_LOG_LEVEL_WEBLOG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 112, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297663 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_SYSLOG - assumed 'ZM_LOG_LEVEL_SYSLOG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 117, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297668 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG - assumed 'ZM_LOG_DEBUG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 136, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297672 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG_TARGET - assumed 'ZM_LOG_DEBUG_TARGET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 137, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.297976 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_COOKIE_LIFETIME - assumed 'ZM_COOKIE_LIFETIME' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/session.php on line 11, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.298133 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_COOKIE_LIFETIME - assumed 'ZM_COOKIE_LIFETIME' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/session.php on line 39, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.298144 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  A non-numeric value encountered in /usr/share/zoneminder/www/includes/session.php on line 39, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.298150 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_COOKIE_LIFETIME - assumed 'ZM_COOKIE_LIFETIME' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/session.php on line 40, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.298154 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_COOKIE_LIFETIME - assumed 'ZM_COOKIE_LIFETIME' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/session.php on line 40, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.298158 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  A non-numeric value encountered in /usr/share/zoneminder/www/includes/session.php on line 40, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302252 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_MIN_STREAMING_PORT - assumed 'ZM_MIN_STREAMING_PORT' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/functions.php on line 106, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302367 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_OPT_USE_AUTH - assumed 'ZM_OPT_USE_AUTH' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 296, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302380 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_LOGINS - assumed 'ZM_AUTH_HASH_LOGINS' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 306, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302385 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_TYPE - assumed 'ZM_AUTH_TYPE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 321, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302391 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_LOGINS - assumed 'ZM_AUTH_HASH_LOGINS' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 264, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302395 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 264, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302637 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_IPS - assumed 'ZM_AUTH_HASH_IPS' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 331, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302651 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_OPT_USE_AUTH - assumed 'ZM_OPT_USE_AUTH' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 216, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.302656 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_RELAY - assumed 'ZM_AUTH_RELAY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/auth.php on line 216, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.305289 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LANG_DEFAULT - assumed 'ZM_LANG_DEFAULT' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/lang.php on line 46, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307597 2021] [php7:notice] [pid 279548] [client 192.168.0.240:62176] WAR [System language file lang/ZM_LANG_DEFAULT.php does not exist.], referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307672 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_BANDWIDTH_DEFAULT - assumed 'ZM_BANDWIDTH_DEFAULT' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/skins/classic/skin.php on line 22, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307711 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_ENABLE_CSRF_MAGIC - assumed 'ZM_ENABLE_CSRF_MAGIC' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/index.php on line 226, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307735 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_SECRET - assumed 'ZM_AUTH_HASH_SECRET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/csrf/csrf-magic.php on line 55, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307742 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_AUTH_HASH_SECRET - assumed 'ZM_AUTH_HASH_SECRET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/csrf/csrf-magic.php on line 105, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307767 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_OPT_USE_AUTH - assumed 'ZM_OPT_USE_AUTH' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/index.php on line 251, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307777 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_SHOW_PRIVACY - assumed 'ZM_SHOW_PRIVACY' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/index.php on line 267, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307806 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_DATABASE - assumed 'ZM_LOG_LEVEL_DATABASE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 102, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307814 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_FILE - assumed 'ZM_LOG_LEVEL_FILE' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 107, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307817 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_WEBLOG - assumed 'ZM_LOG_LEVEL_WEBLOG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 112, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307820 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_LEVEL_SYSLOG - assumed 'ZM_LOG_LEVEL_SYSLOG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 117, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307827 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG - assumed 'ZM_LOG_DEBUG' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 136, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.307831 2021] [php7:warn] [pid 279548] [client 192.168.0.240:62176] PHP Warning:  Use of undefined constant ZM_LOG_DEBUG_TARGET - assumed 'ZM_LOG_DEBUG_TARGET' (this will throw an Error in a future version of PHP) in /usr/share/zoneminder/www/includes/logger.php on line 137, referer: http://192.168.0.230/zm/index.php?view=privacy
    [Sun Feb 21 20:53:03.310910 2021] [php7:notice] [pid 279548] [client 192.168.0.240:62176] ERR [TypeError%3A%20canEdit%20is%20undefined], referer: http://192.168.0.230/zm/index.php?view=privacy

    原因

    最初のログからわかる通り「ZM_LOG_LEVEL_DATABASE」等の環境変数が無くてエラーになっています。その環境変数は「/usr/share/zoneminder/db/zm_create.sql」で作成され、MySQLの「zm」データベース「Config」テーブルに存在しているはずが、それが無いためにエラーとなっていました。

    対策

    ZoneMinderのDBを再作成します。

    # 対象のDBを削除
    sudo mysql
    drop database zm
    quit
    
    # SQL文中にDB作成も入っているので、以下を流し込む
    sudo mysql -uroot < /usr/share/zoneminder/db/zm_create.sql

  • ZoneMinderの録画用HDDを新規追加する方法

    HDDを新規追加し、既存データを移行する段取りを紹介します。またZoneMinderはカメラ10台程度であれば、3MByte/秒以上(カメラ1台当たり80kbyte~500kbyte)の書き込みが出来ればいいことから、HDDにはわざとCMRではなくSMR(瓦)の2.5inch HDDを利用しています。

    初めに

    この投稿では2TBのHDDに引っ越ししていますが、引っ越し前はST1000LM048×2台でLinuxのソフトウェアRAIDを組み、うち500GByteを監視カメラ用の領域として利用していました。

    防犯カメラ用のHDDと言うと、一般的には録画用途に専用設計されたHDDを思い浮かべるかと思います。有名どころではWD(ウェスタンデジタル)のPurpleシリーズと、SeagateのSkyhawkです。
    まともなメーカーのDVRの場合には、PurpleやSkyhawk等の防犯カメラ専用に売られているHDDでないと、認識すらしてくれないこともある為、SHOP店員さんに「防犯カメラの録画用HDDをください」と言うと、それらシリーズを進められることが多いです。

    しかし、PurpleもSkyhawkも高価な為、庶民的な価格のHDDを用いて(必要ならRAID1を組んで)録画データを記録したい為、私は敢えてSMRのHDDを利用しています。Linuxで認識可能なHDDで、かつ速度がある程度出れば利用可能な点もZoneMinderならではの利点ですね。

    私は、5インチベイに3.5インチHDDをスロットインで搭載するケースを利用していることもあり、今回24時間365日運用の消費電力削減も狙って東芝の「MQ04ABD200」を購入しました。お値段6000円程度です。

    ※WDのPurple3TBはAmazonでも9000円程度です。特にこだわりが無ければPurple3TBでも良いかと思います。
    ※市販品のDVRを利用する場合には、DVRがサポートしているHDD以外は認識しない可能性があります。

    引っ越し作業(旧HDD⇒新HDDへ)

    引っ越し作業は以下の流れで実施します。

    1. 新HDDの物理的な取り付け(ケース内部にねじ止めし、電源、SATAケーブルを接続する)
    2. 新HDDのパーティション作成とフォーマット
    3. ZoneMinderの停止(データ引っ越し中に常時録画されると困る為)
    4. 旧HDD⇒新HDDへデータを移動
    5. /etc/fstabの記載とマウントテスト
    6. ZoneMinderの開始
    7. テスト:再起動後に想定した動作となる事を確認

    1.新HDDの物理的な取り付け(ケース内部にねじ止めし、電源、SATAケーブルを接続する)

    筐体を開けて、HDDの取り付けを適宜行って下さい。2.5インチのHDDを一般的なPCケースに取り付ける場合にはマウンタが必要です。400円ぐらいです。5インチベイに2.5インチHDDを4台取り付け可能な物だと、こういった製品もありますが、少し割高です(私は利用しています)。

    2.新HDDのパーティション作成とフォーマット

    fdiskに「-l」オプションを付けて実行することで、対象HDDの情報が確認可能です。
    今回取り付けたHDDの型番、容量が表示されるHDDがどれかを確認します。
    ちなみに、当環境では/dev/sdeでした。

    sudo fdisk -l /dev/sda
    sudo fdisk -l /dev/sdb
    sudo fdisk -l /dev/sdc
    sudo fdisk -l /dev/sdd
    sudo fdisk -l /dev/sde
    sudo fdisk -l /dev/sdf
    
    # Disk /dev/sde: 1.84 TiB, 2000398934016 bytes, 3907029168 sectors
    # ↑★ここで/dev/sdeであることを確認
    # Disk model: TOSHIBA MQ04ABD2 ←★ここで東芝のMQ04ABD2である事を確認
    # Units: sectors of 1 * 512 = 512 bytes
    # Sector size (logical/physical): 512 bytes / 4096 bytes
    # I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    
    sudo fdisk /dev/sde
    
    # nで新規パーティション追加を指定し、後は、デフォルトを選択。
    # 最後にwで保存して終了
    Command (m for help): n
    Partition type
       p   primary (0 primary, 0 extended, 4 free)
       e   extended (container for logical partitions)
    Select (default p): p
    Partition number (1-4, default 1):
    First sector (2048-3907029167, default 2048):
    Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-3907029167, default 39070291
    
    Created a new partition 1 of type 'Linux' and of size 1.8 TiB.
    
    Command (m for help): w
    
    sudo mkfs.ext4  /dev/sde

    3.ZoneMinderの停止(データ引っ越し中に常時録画されると困る為)

    単純にZoneMinderを停止させます。

    sudo systemctl stop zoneminder.service

    4.旧HDD⇒新HDDへデータを移動

    /mnt/tmpディレクトリを作成し、そこに一時的に新HDDの領域をマウントしてデータ移動します。ZoneMinderで録画先として指定している領域のデータを新HDDに移動させます。

    以下では移動元を「/var/cache/zoneminder/events」としていますが、ZoneMinderの管理画面「オプション⇒Storage」から確認可能です。

    mkdir /mnt/tmp
    sudo mount /dev/sde1 /mnt/tmp
    
    cd /var/cache/zoneminder/events
    sudo mv ./* ../tmp/
    
    # 最後にマウントを外しておく
    sudo umount /mnt/tmp

    ディスク容量によりますが、上記作業は1時間以上かかると思いますので、終わるまでひたすら待ちます。

    5./etc/fstabの記載とマウントテスト

    ずっと昔は/etc/fstabには/dev/sde1がどこにマウントされるかを記載するのが主流だったのですが、HDDの接続先を変更するだけで、sdeだったものがsdcになったりと不安定要素となります。

    ですので、最近の流行に倣って/etc/fstabはUUIDで記載します。

    # UUIDを確認する
    sudo tune2fs -l /dev/sde1 | grep UUID
    Filesystem UUID:          db2972c3-1c69-4101-90e4-7c778d8f93aa
    
    # /etc/fstabを記載する
    sudo vi /etc/fstab
    
    # 以下のように追記します。
    # viを上書きして終了するのは、「ESCキー」を押してから「:wq」エンターです
    /dev/disk/by-uuid/db2972c3-1c69-4101-90e4-7c778d8f93aa /var/cache/zoneminder/events ext4 defaults 0 0
    
    # マウントテスト
    sudo mount -a
    
    df
    /dev/sde1      1921802520   89125920 1734984540   5% /var/cache/zoneminder/events 
    # ↑dfの結果、/etc/fstabに記載した領域がマウントされている事

    6.ZoneMinderの開始

    開始処理で変なエラーが出ないことと、ZoneMinderの管理画面にログインし、各種カメラが正常に録画されている事等を確認します。

    sudo systemctl start zoneminder.service


    7.テスト:再起動後に想定した動作となる事を確認

    再起動し、再起動後も問題なく動くことを確認します。

    sudo reboot
    
    # 再起動後にサービスのステータスと、dfコマンドで追加したHDDが見えていることを確認
    sudo systemctl status zoneminder.service
    df

    「6.ZoneMinderの開始」で実施した確認作業を再度実施し、問題なければ完了です。

    最後に

    最近のHDDは殆どがSMRになってきていることから、防犯カメラ用HDDについてもSMRのHDDが利用できることを確認できれば、安価に録画システムを構築することが出来ます。更に、2.5インチHDDが利用可能であれば、容量は小さいですが、消費電力を抑えることが出来ます。


  • ZoneMinderでの動体検知制度調整方法

    ZoneMinderでは、動体検知があった場合にイベントを記録し、後でイベントが発生した時間帯のみ録画映像を確認することが可能です。

    しかし、この動体検知は、どの程度画面上動きがあったかを検知する閾値を設定することが可能です。具体的には以下の図の「参照画像ブレンド」の値を上下させることで調整可能で、小さくすると少しの動きでも検知し、大きくすると、大きな動きのみを検知します。

    場所
    屋内6.25%程度を推奨
    屋外12.5%~25%程度を推奨
    参照画像ブレンドの推奨設定値

    ご参考までに、私が屋内、屋外で設定している値は以下の通りです。

    屋内の参照画像ブレンド設定値:6.25%

    屋内の参照画像ブレンド設定値:25%

    カメラの動体検知制度は、運用しながら決めていくのが良いので、一度設定して数日運用し、イベント発生件数を確認後以下の通り調整します。

    過検知が多い画像参照ブレンドの数字を上げる
    検知すべきものが検知されていない画像参照ブレンドの数字を下げる

    また、カメラの一部にだけ、「別にこのエリアは検知すべきではないのに、木の葉が揺れてよく検知されてしまう」というような場合には、「イベント検知エリアの設定」を行うことで、イベント検知する領域を指定することが可能です。


  • ZoneMinderでの上書き録画(定期削除)方法

    ZoneMinderをデフォルトインストールした直後は、HDD容量が一杯になる前に古い録画ファイルを削除して空き容量を確保する設定がされていません。長期運用するためには必須の機能となる為、その設定方法を紹介します。

    設定方法

    1. フィルター画面より「フィルタを使用する」から、PurgeWhenFullを選択します。
    2. ディスクの割合が95%以上になったら削除されるよう、以下の通り設定します。
    3. 「マッチした全てを削除」及び「バックグラウンドでフィルタを実行」を選択します。
    4. 「保存」を押下します。
    5. 「実行」を押下します。
    6. 上記までで設定完了です。数日間運用し、DISKが一杯になった場合に削除されることを確認してください。

    その他TIPS

    録画期間を非常に長く設定するために、8TBやそれ以上のHDDをあてがっている場合、95%も録画がされるのは半年後、1年後になる可能性もあります。そういった場合、手っ取り早くテストするためには、「ディスクの割合」を「10」%以上等、少ない値を設定してみてください。

    または、該当HDDの録画エリア以外の場所に、適当なファイルを連続コピーしてHDDの空き容量をわざと上げて検証するのもいいかもしれません。


  • tp-Link Tapo c100/c200で無線接続が不安定⇒改善

    tp-link製のtapo c100とtapo c200と言うカメラを屋内で利用していましたが、無線LANが定期的に切れる問題で困っていました。しかしながら、以下の対策で安定録画可能となりました。

    • ファームウェアを最新版へ更新
    • SSIDの非表示⇒表示へ
    • 複数APで同じSSIDを利用していた場合、カメラ用だけは重複しないSSIDへ変更

    上記3つの対策で安定しました。

    SSID非表示を辞めた背景

    無線LANの設定はセキュリティ強化のために以下を実施していました。

    1. 無線LANアクセスポイントに難しいパスワードを設定
    2. SSIDを非表示にする
    3. 暗号化モードはWPA2(AES)ないしはWPA3を利用する
    4. WPSはPIN番号を利用せず、プッシュボタンのみ有効とする
    5. MACアドレスフィルタリングを設定する
    6. ゲストネットワークを無効にする
    7. パスワードは英数小文字、記号を含めて桁数の多い物を設定する

    スマートホーム製品導入時に、設定アプリの特性上、SSIDを非表示にするとセットアップさえ出来ない機器が存在した為、仕方なく道路から遠い場所のみ、SSIDを非表示にせず運用することとしました。

    そうしたところ、SSID非表示の無線LANアクセスポイントに接続されているtapo c100/c200だけは今まで悩ませられていた以下症状が出なくなりました。

    複数APで同じSSIDを利用するのをやめた背景

    無線APが故障した際に、同じ設定・SSIDでAPを作り直したところ、Tapoデバイス含めTP-LINKのスマートデバイスは全てSSIDが同じにもかかわらずつなぎなおしてくれませんでした。

    しかたなく、全部の危機をリセットし再設定したところ問題なくつながりました。このことから、複数APで同じSSIDを利用していた場合に、不安定になると仮説を立て、無線カメラが接続するSSIDは重複しないようにしたところ、安定しました。

    tp-link tapo c100/c200で発生していた不具合

    • 定期的にTapoアプリから見えなくなる
    • 定期的にonvifによるzoneminderからの録画が出来なくなる
    • (無線が切れているので)Tapoアプリの動体検知通知が飛ばなくなる

    tp-link tapo c100/c200で他に困っている問題

    一番困っていた無線LANアクセスポイントが近いにもかかわらず、無線が切れる問題が解決した為、困っている問題はほぼなくなりました。あえて挙げるとすると以下のみです。

    • 無線LANの届くギリギリの箇所に置いた場合、WIFIが不安定となる⇒この点については仕方ないとして諦めており、無線LANアクセスポイントの追加、もしくはPoEタイプのカメラで代替するなどして対策しています
    • tapo c200が再起動した後、カメラが回るのですが、たまに見ている方向が微妙にずれていることがある⇒天吊りではなく、ピアノの上のカバーの上に置いているものなので、たまに手で向きを直してやっています

    無線LANが頻繁に切れていた時期は、有線の製品に全部置き換えようとも思いましたが、上記の通り対策後は安定しているため、壊れるまで使い続けようかと思います。

    【後日追記】一部個体が不安定な事象について

    tapoはc100が2台、c200が4台の計6台を運用しています。うち、1台のみ上記対応を行い環境・設定も同じにもかかわらず定期的にカメラがハングアップする個体がありました。

    実は、上記の調子の悪い一台は購入時から「なんか不安定な個体だな」と思い、何度かリセットしたことがあります。こちらに関しては、ベンダ問い合わせを実施予定です。

    上記、部屋のドアの開け閉めを行った際によく発生していたことから、SSIDの重複をなくしたことで安定しました。


  • ZoneMinder1.35.14で起動エラーが出る場合の対処

    ZoneMinderの最新版に更新したところ、ZoneMinderが起動しなくなりました。たいていの場合ZoneMinderアップデート後の起動エラーはDBが原因なので、手作業でDBをアップデートしようとしたところ、以下のエラーが発生しました。

    /usr/share/zoneminder/db$ sudo mysql zm < zm_update-1.35.14.sql
    This update may make changes that require SUPER privileges. If you see an error message saying:
    
    ERROR 1419 (HY000) at line 298: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_functio
    This update may make changes that require SUPER privileges. If you see an error message saying:\n\nERROR 1419 (HY000) at line 298: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)\n\nYou will have to either run this update as root manually using something like (on ubuntu/debian)\n\nsudo mysql --defaults-file=/etc/mysql/debian.cnf zm < /usr/share/zoneminder/db/zm_update-1.35.14.sql\n\nOR\n\nsudo mysql --defaults-file=/etc/mysql/debian.cnf "set global log_bin_trust_function_creators=1;"\nsudo zmupdate.pl\n
    

    とのこと。とりあえず、log_bin_trust_function_creatorsを有効にしたのち、zmupdate.plを叩くことに。

    mysql>  SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
    +---------------------------------+-------+
    | Variable_name                   | Value |
    +---------------------------------+-------+
    | log_bin_trust_function_creators | OFF   |
    +---------------------------------+-------+
    1 row in set (0.01 sec)
    
    mysql>
    mysql> set global log_bin_trust_function_creators=1;
    Query OK, 0 rows affected (0.00 sec)
    
    mysql>
    mysql>  SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
    +---------------------------------+-------+
    | Variable_name                   | Value |
    +---------------------------------+-------+
    | log_bin_trust_function_creators | ON    |
    +---------------------------------+-------+
    1 row in set (0.00 sec)
    
    exit;

    で、シェルで以下を実行

    sudo /usr/bin/zmupdate.pl
    sudo systemctl restart zoneminder.service
    

    上記までで動きました。MySQLのlog_bin_trust_function_creatorsの設定は、MySQLの再起動で元に戻ってしまったので、他の対策も必要かもしれません。(追ってアップデートします)


  • 監視カメラシステム全体の電気代削減について

    ZoneMinderを通常運用しだすと、録画システムと言う位置づけの為、24h365d(24時間365日)での稼働が求められるため、安定性と電気代、騒音が気になるところです。消費電力を下げることは、冷却システムの簡易化、引いては騒音、電気代の削減につながります。

    また、契約している電力会社を適切に見直すことで、電気代そのものを安くすることもできます。本投稿では、電気代削減に焦点をあて、私のノウハウを公開いたします。

    消費電力そのものを下げるためのハードウェア選定

    CPU

    CPUを用いてffmpegによるリアルタイムエンコードをするか否かによって選択肢が分かれます。カメラ側でH.264エンコードをサポートしており、ZoneMinderサーバでは、「オプション>Storage」の設定で、「H264 Camera Passthrough」を選択するのであれば、ffmpegによるエンコードがされない為、CPUは低消費電力のCPUを選択して問題ありません。

    ZoneMinderでCPU負荷を抑える為、H264のカメラ画像をそのまま保存する設定

    反対に、USBカメラ等を用いており、ffmpegでエンコードしながら保存する場合には、多少高いCPUを購入するといいと思います。

    HDD

    保存したい期間×カメラ台数で容量を見積もります。お勧めは8千円以下で購入できる2.5inch HDDです。私は消費電力が2w以下となるSeagateのST2000LM015をよく使います。Western Digital Purpleも何度も納品したことがありますが、「3~5年程度でカメラのLEDが壊れたので、あわせて交換してほしい」と言われ交換してしまうため、まだWestern Digital Purpleの故障でHDD交換したことはありません。消費電力が5.3wの6TB(WD60PURZ)辺りが良いと思います。

    電力会社の見直し

    防犯カメラを24h365d(24時間365日)で10台も設置すると、月の電気代が1000円~2000円上がることもざらではありません。そこで、安い電気会社を選択することをお勧めします。ご参考までに我が家の電気代の明細は以下の通りです。

    我が家の電気代

    ポイントは、電力量2段料金と、電力量3段料金とが非常に安い点です。東電の従量電灯B・Cの電気代は下表のとおりです。~120whは通常の照明と冷蔵庫だけで使い切ってしまう為、システム全体の消費電力を下げる対策と「安い電力会社」の選択を併用したいところです。

    項目電力量東電の電気代目安我が家
    電力量1段料金~120wh19円88銭19円69銭
    電力量2段料金121~300wh26円48銭23円70銭
    電力量3段料金300wh~30円57銭23円99銭

    携帯電話の電話代と同じで、格安SIM化すれば月の電話代を1万円から2000円に下げられるのと同様、電気代も契約次第で大幅に削減できるため、見直してみてもいいと思います。

    ご参考ページ


  • ZoneMinderで日本語表示時設定している環境でapt update後に文字化けする対策

    日本語化対応を行った環境下で、apt updateを行った場合、ZoneMinder画面が文字化けすることがあります。

    原因

    以下ファイルで、UTF-8を指定するべきところをShift_JIS指定しているためです。

    /usr/share/zoneminder/www/lang/ja_jp.php

    対策

    以下コマンドを実行してください。

    sudo sed -i 's/Shift_JIS/UTF-8/g' /usr/share/zoneminder/www/lang/ja_jp.php

    本件、apt updateしてZoneMinderが更新されるたびに発生する為、apt update後に実施するようにしてもいいかもしれません。


  • apt update時の 「Access denied for user ‘debian-sys-maint’@’localhost’ (using password: YES)」エラー対策

    ZoneMinderインストール後に、apt updateした場合に、下記エラーが出力されてupdateがエラー終了する問題への対応策です。

    エラー内容

    Setting up zoneminder (1.35.10~20201016.44-focal) ...
    detected systemd
    Detected db service is mysql.service
    Checking for db
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    Creating zm db
    ERROR 1045 (28000): Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)
    Error creating db.
    dpkg: error processing package zoneminder (--configure):
     installed zoneminder package post-installation script subprocess returned error exit status 1
    Errors were encountered while processing:
     zoneminder
    Log ended: 2020-10-17  12:06:38
    

    原因

    エラーメッセージの通り、debian-sys-maintユーザーでDBの更新をしようとした際に、ログインエラーが発生した為です。

    対策

    debian-sys-maintユーザーでDBログイン出来るように、MySQLにログインし、パスワードを設定してやります。

    # MySQLでdebian-sys-maintユーザーに設定するパスワードを確認
    sudo cat /etc/mysql/debian.cnf  | grep password
    password = 5klCD94cmdDac9a8
    password = 5klCD94cmdDac9a8
    
    # debian-sys-maintユーザーを上記で確認したパスワードを付与して作成
    sudo mysql
    CREATE USER 'debian-sys-maint' IDENTIFIED BY '5klCD94cmdDac9a8';
    GRANT ALL PRIVILEGES on *.* TO `debian-sys-maint` IDENTIFIED BY '5klCD94cmdDac9a8' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    quit

    ※上記パスワード「5klCD94cmdDac9a8」は、公開用に適当な文字列にしてあります。適宜、/etc/apt/debian.cnfで確認した結果で読み替えてください。