Code Monkey home page Code Monkey logo

zmeventnotification's Introduction

ZoneMinder

Bounty Source Join Slack drawing

All documentation for ZoneMinder is now online at https://zoneminder.readthedocs.org

Overview

ZoneMinder is an integrated set of applications which provide a complete surveillance solution allowing capture, analysis, recording and monitoring of any CCTV or security cameras attached to a Linux based machine. It is designed to run on distributions which support the Video For Linux (V4L) interface and has been tested with video cameras attached to BTTV cards, various USB cameras and also supports most IP network cameras.

Contacting the Development Team

Before creating an issue in our github forum, please read our posting rules: https://github.com/ZoneMinder/ZoneMinder/wiki/Github-Posting-Rules

Our Dockerfile has moved

Please file issues against the ZoneMinder Dockerfile here: https://github.com/ZoneMinder/zmdockerfiles

Installation Methods

Install from a Package Repository

This is the recommended method to install ZoneMinder onto your system. ZoneMinder packages are maintained for the following distros:

If a repository that hosts ZoneMinder packages is not available for your distro, then you are encouraged to build your own package, rather than build from source. While each distro is different in ways that set it apart from all the others, they are often similar enough to allow you to adapt another distro's package building instructions to your own.

Building from Source is Discouraged

Historically, installing ZoneMinder onto your system required building from source code by issuing the traditional configure, make, make install commands. To get ZoneMinder to build, all of its dependencies had to be determined and installed beforehand. Init and logrotate scripts had to be manually copied into place following the build. Optional packages such as jscalendar and Cambozola had to be manually installed. Uninstalls could leave stale files around, which could cause problems during an upgrade. Speaking of upgrades, when it comes time to upgrade all these manual steps must be repeated again.

Better methods exist today that do much of this for you. The current development team, along with other volunteers, have taken great strides in providing the resources necessary to avoid building from source.

Building a ZoneMinder Package

Building ZoneMinder into a package is not any harder than building from source. As a matter of fact, if you have successfully built ZoneMinder from source in the past, then you may find these steps to be easier.

When building a package, it is best to do this work in a separate environment, dedicated to development purposes. This could be as simple as creating a virtual machine, using Docker, or using mock. All it takes is one “Oops” to regret doing this work on your production server.

Lastly, if you desire to build a development snapshot from the master branch, it is recommended you first build your package using an official release of ZoneMinder. This will help identify whether any problems you may encounter are caused by the build process or is a new issue in the master branch.

Please visit our ReadtheDocs site for distro specific instructions.

Package Maintainers

Many of the ZoneMinder configuration variable default values are not configurable at build time through autotools or cmake. A new tool called zmeditconfigdata.sh has been added to allow package maintainers to manipulate any variable stored in ConfigData.pm without patching the source.

For example, let's say I have created a new ZoneMinder package that contains the cambozola javascript file. However, by default cambozola support is turned off. To fix that, add this to the packaging script:

./utils/zmeditconfigdata.sh ZM_OPT_CAMBOZOLA yes

Note that zmeditconfigdata.sh is intended to be called, from the root build folder, prior to running cmake or configure.

Docker

Docker is a system to run applications inside isolated containers. ZoneMinder, and the ZM webserver, will run using the Dockerfile contained in this repository. However, there is still work needed to ensure that the main ZM features work properly and are documented.

Contribution Model and Development

Pull requests are very welcome! If you would like to contribute, please follow the following steps. While step 3 is optional, it is preferred.

  1. Fork the repo
  2. Open an issue at our GitHub Issues Tracker. Follow the issue template to describe the bug or security issue you found. Please note feature requests or questions should be posted in our user forum or Slack channel.
  3. Create your feature branch (git checkout -b 456-my-new-feature)
  4. Commit your changes (git commit -am 'Added some feature') It is preferred that you 'commit early and often' instead of bunching all changes into a single commit.
  5. Push your branch to your fork on github (git push origin 456-my-new-feature)
  6. Create new Pull Request
  7. The team will then review, discuss and hopefully merge your changes.

Analytics

zmeventnotification's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zmeventnotification's Issues

malformed json can crash the server

Discovered while playing with different websocket examples.

The code that crashes things:

#!/usr/bin/env python

import asyncio
import websockets

@asyncio.coroutine
def hello():
    websocket = yield from websockets.connect('wss://<zm-server>:9000/')
    name = ("blah blah")
    yield from websocket.send(name)
    print("> {}".format(name))
    greeting = yield from websocket.recv()
    print("< {}".format(greeting))
    yield from websocket.close()

asyncio.get_event_loop().run_until_complete(hello())

The results, when running zmeventnotification independently:

user@server:~$  zmeventnotification.pl
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "blah blah") at /usr/bin/zmeventnotification.pl line 251.

and in ZoneMinder logs when run as a daemon:

2015-10-18 23:48:17.808020  zmdc    13581   ERR 'zmeventnotification.pl' exited abnormally, exit status 9   zmdc.pl 
2015-10-18 23:48:17.800640  zmeventnotification 13822   INF Websockets: New Connection Handshake requested from 192.168.1.51 state=pending auth zmeventnotification.pl  
2015-10-18 23:48:17.794160  zmeventnotification 13822   INF got a websocket connection from 192.168.1.51    zmeventnotification.pl  

When running as a daemon it will get restarted soon, but the socket is left open when it crashes and blocks restarts for a bit.

Unable to connect to server

I just installed that Pushserver Stuff, but when i run zmdc.pl status zmeventnotification.pl i only get:
Unable to connect to server

I that Pushserver offline? Is it possible to run an own Pushserver? I have a Apple Developer Account (paid) and can get own Push Certs.

SSL Problem

Sorry to bother you but I am really stuck after several hours and rebuilds.

I have been following the very good install guide adding this to my ZM 1.30.4 build. The SSL certs where in a different dir so I have updated the .INI to point to current location. However I keep getting the following error:
Failed starting server: SSL_cert_file /etc/ssl/certs/zoneminder.crt /etc/ssl/certs/zoneminder.crt can't be used: No such file or directory at /usr/share/perl5/IO/Socket/SSL.pm line 2216.

I've read the SSL.pm file but cannot work out what is missing can you point me to what I have mis-configured ?

Pass alarm cause to the hook

It would be nice if the event server could pass the alarm cause to the hook along with the other information about the alarm. It can be nice for the notification to know what zone caused the alarm.

Push Issue

Hi There,

I've got an issue, and I'm unable to work out what to do or where to goto next. As far as I can tell everything looks to be working, but I am unable to get any notifications to my Android phone.

It's not clear if I need to add my device ID to your script, or if the submission from the application should set this up. I've specified for the token to go into /tmp/zm since the permissions are already good for the www user to write to.

Could you please take a look at the following and see if you can work it out. Any help would be appreciated.

Jan 9 20:09:34 behemoth zmdc[3447]: INF ['zmeventnotification.pl' sending stop to pid 3503 at 16/01/09 20:09:34]
Jan 9 20:09:35 behemoth zmdc[3447]: INF ['zmeventnotification.pl' exited, signal 14]
Jan 9 20:09:48 behemoth zmdc[3447]: INF ['zmeventnotification.pl' starting at 16/01/09 20:09:48, pid = 21102]
Jan 9 20:09:48 behemoth zmdc[21102]: INF ['zmeventnotification.pl' started at 16/01/09 20:09:48]
Jan 9 20:09:48 behemoth zmeventnotification[21102]: INF [Push enabled via PushProxy]
Jan 9 20:09:48 behemoth zmeventnotification[21102]: INF [direct APNS disabled]
Jan 9 20:09:49 behemoth zmeventnotification[21102]: INF [Event Notification daemon v 0.5 starting]
Jan 9 20:09:49 behemoth zmeventnotification[21102]: INF [Creating /tmp/zm/tokens.txt]
Jan 9 20:09:49 behemoth zmeventnotification[21102]: INF [Total event client connections: 0]
Jan 9 20:09:49 behemoth zmeventnotification[21102]: INF [Reloading Monitors...]
Jan 9 20:09:49 behemoth zmeventnotification[21102]: INF [Loading monitors]
Jan 9 20:09:49 behemoth zmeventnotification[21102]: INF [Checking https://pliablepixels.ddns.net:8801 reachability...]
Jan 9 20:09:51 behemoth zmeventnotification[21102]: INF [PushProxy https://pliablepixels.ddns.net:8801 is reachable.]
Jan 9 20:09:51 behemoth zmeventnotification[21102]: INF [Web Socket Event Server listening on port 9000]
Jan 9 20:09:53 behemoth zmeventnotification[21102]: INF [got a websocket connection from ::ffff:10.1.1.19 (0) active connections]
Jan 9 20:09:53 behemoth zmeventnotification[21102]: INF [Websocket remotely disconnected from ::ffff:10.1.1.19]
Jan 9 20:09:57 behemoth zmeventnotification[21102]: INF [got a websocket connection from ::ffff:10.1.1.19 (0) active connections]
Jan 9 20:09:57 behemoth zmeventnotification[21102]: INF [Websocket remotely disconnected from ::ffff:10.1.1.19]
Jan 9 20:10:02 behemoth zmeventnotification[21102]: INF [got a websocket connection from ::ffff:10.1.1.19 (0) active connections]
Jan 9 20:10:02 behemoth zmeventnotification[21102]: INF [Websocket remotely disconnected from ::ffff:10.1.1.19]
Jan 9 20:10:36 behemoth zmeventnotification[21102]: INF [New event 340 reported for HD-Feed]
Jan 9 20:10:37 behemoth zmeventnotification[21102]: INF [Broadcasting new events to all 0 websocket clients]
Jan 9 20:10:40 behemoth zmeventnotification[21102]: INF [got a websocket connection from ::ffff:10.8.0.6 (0) active connections]
Jan 9 20:10:40 behemoth zmeventnotification[21102]: INF [Websocket remotely disconnected from ::ffff:10.8.0.6]
Jan 9 20:10:47 behemoth zmeventnotification[21102]: INF [got a websocket connection from ::ffff:10.8.0.6 (0) active connections]

Many Thanks

Rob

PTZ issues ... was working but doesn't seem to be now.

Hi plablepixels,

I was helping you out testing while you fixed the settings but now I notice that I cant get my PTZ to work anymore. Im not sure when it stopped .. I started off with one inexpensive PTZ cam and it turned out to be very decent and I was able to get the PTZ to work in zoneminder so I bought 2 more ... I believe it was before we started messing with fixing the settings issues we were having but when I had it set up with the one PTZ cam it was functioning sort of... it did have a bug that when you put the phone in landscape only the bottom 3 points in the "movement star" would work .. the lower left, lower and lower right .. you couldn't raise it or use the left and right but it fully worked in portrait ... lol got a little side tracked but now all three wont work .. the presets would work before but don't anymore either .. I made a log and see some weird things .... maybe its my server or something .. here is the log:

Logs for version:1.2.515 (android) Feb 3, 2018 12:35 AM ERROR Error sending event command "CSRF check failedif (top != self) {top.location.href = self.location.href;}var csrfMagicToken = "sid:d0d1fe0c36029e09046eacbe08d4589cb11f540b,1517636115";var csrfMagicName = "__csrf_magic";\n \n

CSRF check failed. Your form session may have expired, or you may not have\n cookies enabled.

\n \n

Debug:

CsrfMagic.end();\n" Feb 3, 2018 12:35 AM INFO MontageCtrl:Stopping network pull... Feb 3, 2018 12:35 AM INFO Restarting montage timer, closing Modal... Feb 3, 2018 12:35 AM DEBUG Modal removed - killing connkey Feb 3, 2018 12:35 AM DEBUG Modal is open, closing it Feb 3, 2018 12:35 AM ERROR Error sending PTZ:"CSRF check failedif (top != self) {top.location.href = self.location.href;}var csrfMagicToken = "sid:cccf958243382eae7632d20ab8cc71261aad694b,1517636110";var csrfMagicName = "__csrf_magic";\n \n

CSRF check failed. Your form session may have expired, or you may not have\n cookies enabled.

\n \n

Debug:

CsrfMagic.end();\n" Feb 3, 2018 12:35 AM DEBUG PTZ command is a preset, so skipping xge/lge Feb 3, 2018 12:35 AM INFO Switching playback via nphzms Feb 3, 2018 12:35 AM INFO ConfigurePTZ Modal: ControlDB reports PTZ command to be moveCon Feb 3, 2018 12:35 AM DEBUG ConfigurePTZ Number of presets is 16 Feb 3, 2018 12:35 AM DEBUG ConfigurePTZ Preset value is 1 Feb 3, 2018 12:35 AM DEBUG configurePTZ: control data returned {"control":{"Control":{"Id":"12","Name":"Vstarcam_C24S","Type":"Remote","Protocol":"Vstarcam_C24S","CanWake":"0","CanSleep":"0","CanReset":"1","CanZoom":"0","CanAutoZoom":"0","CanZoomAbs":"0","CanZoomRel":"0","CanZoomCon":"0","MinZoomRange":"0","MaxZoomRange":"0","MinZoomStep":"0","MaxZoomStep":"0","HasZoomSpeed":"0","MinZoomSpeed":"0","MaxZoomSpeed":"0","CanFocus":"0","CanAutoFocus":"0","CanFocusAbs":"0","CanFocusRel":"0","CanFocusCon":"0","MinFocusRange":"0","MaxFocusRange":"0","MinFocusStep":"0","MaxFocusStep":"0","HasFocusSpeed":"0","MinFocusSpeed":"0","MaxFocusSpeed":"0","CanIris":"1","CanAutoIris":"0","CanIrisAbs":"1","CanIrisRel":"0","CanIrisCon":"0","MinIrisRange":"1","MaxIrisRange":"238","MinIrisStep":"1","MaxIrisStep":"10","HasIrisSpeed":"0","MinIrisSpeed":"0","MaxIrisSpeed":"0","CanGain":"0","CanAutoGain":"0","CanGainAbs":"0","CanGainRel":"0","CanGainCon":"0","MinGainRange":"0","MaxGainRange":"0","MinGainStep":"0","MaxGainStep":"0","HasGainSpeed":"0","MinGainSpeed":"0","MaxGainSpeed":"0","CanWhite":"1","CanAutoWhite":"0","CanWhiteAbs":"1","CanWhiteRel":"0","CanWhiteCon":"0","MinWhiteRange":"1","MaxWhiteRange":"238","MinWhiteStep":"1","MaxWhiteStep":"10","HasWhiteSpeed":"0","MinWhiteSpeed":"0","MaxWhiteSpeed":"0","HasPresets":"1","NumPresets":"16","HasHomePreset":"1","CanSetPresets":"1","CanMove":"1","CanMoveDiag":"1","CanMoveMap":"0","CanMoveAbs":"0","CanMoveRel":"0","CanMoveCon":"1","CanPan":"1","MinPanRange":"0","MaxPanRange":"0","MinPanStep":"0","MaxPanStep":"0","HasPanSpeed":"0","MinPanSpeed":"0","MaxPanSpeed":"0","HasTurboPan":"0","TurboPanSpeed":"0","CanTilt":"1","MinTiltRange":"0","MaxTiltRange":"0","MinTiltStep":"0","MaxTiltStep":"0","HasTiltSpeed":"0","MinTiltSpeed":"0","MaxTiltSpeed":"0","HasTurboTilt":"0","TurboTiltSpeed":"0","CanAutoScan":"0","NumScanPaths":"0"}}} Feb 3, 2018 12:35 AM DEBUG configurePTZ : getting controllable data https:///api/controls/12.json Feb 3, 2018 12:35 AM DEBUG configurePTZ: called with mid=12 Feb 3, 2018 12:35 AM DEBUG Getting zones using:https:///api/zones/forMonitor/12.json Feb 3, 2018 12:35 AM INFO Modal: Stream authentication construction: &auth=88d12c6eba46ce02a3ebf3b3e10dacf7 Feb 3, 2018 12:35 AM INFO DataModel: Extracted a stream authentication key of: 88d12c6eba46ce02a3ebf3b3e10dacf7 Feb 3, 2018 12:35 AM DEBUG DataModel:

Getting auth from https:///index.php?view=watch∣=9&connkey=320589 with mid=9 Feb 3, 2018 12:35 AM DEBUG MonitorModalCtrl

called from app.montage Feb 3, 2018 12:35 AM INFO Using stream mode single Feb 3, 2018 12:35 AM INFO Cancelling montage timer, opening Modal Feb 3, 2018 12:35 AM DEBUG MontageCtrl: Open Monitor Modal with monitor Id=12 and Controllable:1 with control ID:12 Feb 3, 2018 12:35 AM DEBUG doing the jiggle and dance... Feb 3, 2018 12:35 AM DEBUG All images loaded, doing image layout Feb 3, 2018 12:35 AM INFO Arranging as per packery grid Feb 3, 2018 12:35 AM DEBUG All images loaded Feb 3, 2018 12:34 AM DEBUG skipping image refresh, packery is still loading Feb 3, 2018 12:34 AM INFO Monitors that are active and not DOM hidden: 3 while grid has 3 Feb 3, 2018 12:34 AM INFO found a packery layout Feb 3, 2018 12:34 AM INFO Stream authentication construction: &auth=88d12c6eba46ce02a3ebf3b3e10dacf7 Feb 3, 2018 12:34 AM INFO DataModel: Extracted a stream authentication key of: 88d12c6eba46ce02a3ebf3b3e10dacf7 Feb 3, 2018 12:34 AM DEBUG DataModel: Getting auth from https:///index.php?

view=watch∣=9&connkey=368791 with mid=9 Feb 3, 2018 12:34 AM INFO Inside Montage Ctrl:We found 3 monitors Feb 3, 2018 12:34

AM DEBUG skipping image refresh, packery is still loading Feb 3, 2018 12:34 AM DEBUG Setting up cycle interval of:10000 Feb 3, 2018 12:34 AM DEBUG bandwidth: highbw montage refresh set to: 1 Feb 3, 2018 12:34 AM DEBUG Setting image mode to snapshot, will change to image when packery is all done Feb 3, 2018 12:34 AM DEBUG Multiport=0 Feb 3, 2018 12:34 AM INFO sending Cached ZM_MIN_STREAMING_PORT 0 Feb 3, 2018 12:34 AM INFO Returning pre-loaded list of 3 monitors

I don't believe I changed anything on the server and PTZ works in my browser ... could this be a byproduct of your fixes or do I need to look further into my server to see if its blocking something it shouldn't be?

Unable to start zmeventnotification.pl

I get the following error running sudo /usr/bin/zmeventnotification.pl

Global symbol "$printDebugToConsole" requires explicit package name at /usr/bin/zmeventnotification.pl line 254.
Execution of /usr/bin/zmeventnotification.pl aborted due to compilation errors.

I am using Debian Jessie. All dependencies appear to be installed.

Discoverability for auto-conf?

First off, thanks for this great project!

I'm working on a surveillance app where one can add Zoneminder installations for viewing and – thanks to zmeventserver – remote alarms with a custom server. In this app, only those installations that feature an actual deployed and running zmeventserver should be allowed to register for remote alarms.

Is there – beyond just trying to connect – a way to find out whether there is a zmeventserver running and, if so, on which port? Are plugins allowed to modify the Zoneminder config? In that case, could I scan for the presence of certain zmeventserve key in /api/configs/viewByName?

daemon not work

Feb 12 09:57:07 Serveur-Pro zmdc[1416]: INF [Starting pending process, zmeventnotification.pl]
Feb 12 09:57:07 Serveur-Pro zmdc[1416]: INF ['zmeventnotification.pl' starting at 18/02/12 09:57:07, pid = 2209]
Feb 12 09:57:07 Serveur-Pro zmdc[2209]: INF ['zmeventnotification.pl' started at 18/02/12 09:57:07]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Push enabled via FCM]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Event Notification daemon v 0.98.3 starting]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Creating /etc/private/tokens.txt]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Total event client connections: 0]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Reloading Monitors...]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Loading monitors]
Feb 12 09:57:08 Serveur-Pro zmeventnotification[2209]: INF [About to start listening to socket]
Feb 12 09:57:08 Serveur-Pro zmdc[1416]: ERR ['zmeventnotification.pl' exited abnormally, exit status 9]
Feb 12 09:57:27 Serveur-Pro zmc_m1[1689]: INF [Monitor-1: 2000 - Capturing at 20.00 fps]
Feb 12 09:57:07 Serveur-Pro zmdc[2209]: INF ['zmeventnotification.pl' started at 18/02/12 09:57:07]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Push enabled via FCM]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Event Notification daemon v 0.98.3 starting]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Creating /etc/private/tokens.txt]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Total event client connections: 0]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Reloading Monitors...]
Feb 12 09:57:07 Serveur-Pro zmeventnotification[2209]: INF [Loading monitors]
Feb 12 09:57:08 Serveur-Pro zmeventnotification[2209]: INF [About to start listening to socket]
Feb 12 09:57:08 Serveur-Pro zmdc[1416]: ERR ['zmeventnotification.pl' exited abnormally, exit status 9]

ls -al:

lrwxrwxrwx 1 root www-data 42 janv. 5 22:51 cert.pem
lrwxrwxrwx 1 root www-data 45 janv. 5 22:51 privkey.pem

www-data@Serveur-Pro:/home/aurelien$ /usr/bin/zmeventnotification.pl
SSL_cert_file /etc/letsencrypt/live/zm*fr/cert.pem can't be used: Permission denied at /usr/share/perl5/IO/Socket/SSL.pm line 2216.

work with chmod -R 777 /etc/letsencrypt/archive/ but a little brut 777

work with: chown -R root:www-data /etc/letsencrypt/archive/
chmod -R 770 /etc/letsencrypt/archive/

zmeventnotification exits after INF [About to start listening to socket] when run with zmdc

This is reproducible using the zoneminder zmrepo for ether CentOS7 or Fedora24. This isnt a bug with zmeventnotification.pl but i wanted to file this so maybe you could consider adding a small reminder about owenership and permissions around the ssl certs.

So after following the directions i could run zmeventnotification.pl as a root proceess and it would start up and work correctly.

apache 18703 15.1 1.6 654788 60768 ? Sl 10:25 0:16 /usr/bin/zmc -m 1
apache 18712 14.4 1.3 504432 49644 ? S 10:25 0:15 /usr/bin/zma -m 1
apache 18754 0.7 0.6 302492 22896 ? S 10:25 0:00 /usr/bin/perl -wT /usr/bin/zmfilter.pl
apache 18766 0.4 0.3 287640 14156 ? S 10:25 0:00 /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
apache 18781 0.4 0.3 284128 12816 ? S 10:25 0:00 /usr/bin/perl -wT /usr/bin/zmwatch.pl
root 18927 19.0 0.7 325336 25928 pts/0 S 10:26 0:01 /usr/bin/perl -T /usr/bin/zmeventnotification.pl

zmeventnotification[18927]: INF [Push enabled via PushProxy]
zmeventnotification[18927]: INF [direct APNS disabled]
zmeventnotification[18927]: INF [Event Notification daemon v 0.9 starting]
zmeventnotification[18927]: INF [Total event client connections: 0]
zmeventnotification[18927]: INF [Reloading Monitors...]
zmeventnotification[18927]: INF [Loading monitors]
zmeventnotification[18927]: INF [Checking https://185.124.74.36:8801 reachability...]
zmeventnotification[18927]: INF [PushProxy https://185.124.74.36:8801 is reachable.]
zmeventnotification[18927]: INF [About to start listening to socket]
zmeventnotification[18927]: INF [Secure WS(WSS) is enabled...]
zmeventnotification[18927]: INF [Web Socket Event Server listening on port 9000]

After enabling zmeventnotification.pl to run as a daemon with the main zoneminder process it would exit out like below.

zmdc[18274]: INF [Starting pending process, zmeventnotification.pl]
zmdc[18274]: INF ['zmeventnotification.pl' starting at 16/07/20 10:20:50, pid = 18507]
zmdc[18507]: INF ['zmeventnotification.pl' started at 16/07/20 10:20:50]
zmeventnotification[18507]: INF [Push enabled via PushProxy]
zmeventnotification[18507]: INF [direct APNS disabled]
zmeventnotification[18507]: INF [Event Notification daemon v 0.9 starting]
zmeventnotification[18507]: INF [Total event client connections: 0]
zmeventnotification[18507]: INF [Reloading Monitors...]
zmeventnotification[18507]: INF [Loading monitors]
zmeventnotification[18507]: INF [Checking https://185.124.74.36:8801 reachability...]
zmdc[18274]: INF ['zmc -m 2' crashed, signal 6]
zmeventnotification[18507]: INF [PushProxy https://185.124.74.36:8801 is reachable.]
zmeventnotification[18507]: INF [About to start listening to socket]
zmdc[18274]: ERR ['zmeventnotification.pl' exited abnormally, exit status 9]

Both fedora and centos will create a default localhost self signed ssl cert by default. I figred id just plug this into zmeventnotification.pl to use as well.

The issue is the default is mod of 600 and ownership is root:root for the key and cert file. Since zoneminder runs as the apache user on ether of these two OS's it does not have permission to read the cert info by default and when zmeventnotification.pl gets to the step of creating a websocket it will bail out without much useful info.

This is simple to fix. you just need to chmod 660 and chown root:apache on the two ssl cert files.

ls -la /etc/pki/tls/certs/localhost.crt
-rw-rw---- 1 root apache 1452 Jul 19 23:28 /etc/pki/tls/certs/localhost.crt
ls -la /etc/pki/tls/private/localhost.key
-rw-rw---- 1 root apache 1675 Jul 19 23:28 /etc/pki/tls/private/localhost.key

I hope this will help someone out so they dont have to spend the time debugging this like i did.

Thanks for the event notification daemon by the way!

Bad authentication provided

I cannot get zmNinja to connect to the event server with SSL disabled and no authentication used.

Here's the logs from syslog from my Zoneminder instance:

Feb 13 22:16:14 dc730ebb0a9b zmeventnotification[834]: INF [got a websocket connection from 192.168.1.112 (1) active connections]
Feb 13 22:16:14 dc730ebb0a9b zmeventnotification[834]: INF [Websockets: New Connection Handshake requested from 192.168.1.112:54612 state=pending auth]
Feb 13 22:16:14 dc730ebb0a9b zmeventnotification[834]: INF [Contrl: Storing token ...,monlist:1,2,intlist:0,0,pushstate:]
Feb 13 22:16:14 dc730ebb0a9b zmeventnotification[834]: INF [Bad authentication provided by 192.168.1.112]

And here are zmNinja's logs:

Feb 13, 2018 10:16 PM INFO Event Error: {"type":"","event":"push","reason":"PUSHDISABLED","status":"Fail"} 
Feb 13, 2018 10:16 PM DEBUG Real-time event: {"type":"","event":"push","reason":"PUSHDISABLED","status":"Fail"} 
Feb 13, 2018 10:16 PM DEBUG Sending token state enabled Feb 13, 2018 10:16 PM DEBUG Sending Control message 'filter' with monlist=1,2 and interval=0,0 
Feb 13, 2018 10:16 PM DEBUG websocket already initialized ?!? Feb 13, 2018 10:16 PM DEBUG Saving Event Server data 
Feb 13, 2018 10:16 PM INFO Event Error: {"type":"","event":"push","reason":"PUSHDISABLED","status":"Fail"} 
Feb 13, 2018 10:16 PM DEBUG Real-time event: {"type":"","event":"push","reason":"PUSHDISABLED","status":"Fail"} 
Feb 13, 2018 10:16 PM INFO Event Error: {"type":"","event":"auth","status":"Fail","reason":"BADAUTH"} 
Feb 13, 2018 10:16 PM DEBUG Real-time event: {"type":"","event":"auth","status":"Fail","reason":"BADAUTH"} 
Feb 13, 2018 10:16 PM INFO Event Error: {"reason":"PUSHDISABLED","status":"Fail","type":"","event":"push"} 
Feb 13, 2018 10:16 PM DEBUG Real-time event: {"reason":"PUSHDISABLED","status":"Fail","type":"","event":"push"}
Feb 13, 2018 10:16 PM DEBUG openHandShake: state of push is enabled 
Feb 13, 2018 10:16 PM INFO openHandshake: Websocket open, sending Auth 
Feb 13, 2018 10:16 PM INFO Inside openHandshake Feb 13, 2018 10:16 PM DEBUG Sending token state enabled 
Feb 13, 2018 10:16 PM DEBUG Sending Control message 'filter' with monlist=1,2 and interval=0,0 
Feb 13, 2018 10:16 PM DEBUG Setting up websocket error handler Feb 13, 2018 10:16 PM INFO Initializing Websocket with URL ws://
Feb 13, 2018 10:16 PM DEBUG Saving Event Server data 

sending image with ios notification

at the moment, I am using the mqtt notification to go fetch the image and send a notification with an image down to my phone. is there an issue with getting this functionality on ios? I have complex workflow that I use for this that allows me to get the image without exposing my zm to the internet.

  1. get alarm from zm
  2. fetch image using eventid and FID=alarm
  3. upload image to dropbox, get public url for image
  4. send notification using home assistant/nodered to ios device that includes thumbnail of the alarm.
  5. wait 5 minutes and cleanup dropbox image.

this way I don't have to expose my zoneminder to the internet. what are you thoughts on this? can ios take a base64 encoded image for the string?

Not receiving event notifications after upgrading zmeventnotification.pl to 1.2

I have updated zmeventnotification.pl to 1.2 but now I am not getting any notifications. I have tried with different monitor combinations but with the same result. These logs are with one monitor in “modect”, the rest are in Monitor. When an event happens I get the Shared data size conflict error. This happens with all the monitors. I never got this error when I was using 1.1

Thanks for the help,

Here are the logs.

Date/Time
Component Server PID Level Message File Line
2018-09-30 08:29:03 zmeventnotification 20350 INF Storing token ...iJOerwXlrS,monlist:1,5,6,7,8,intlist:0,0,0,0,0,pushstate:enabled zmeventnotification.pl
2018-09-30 08:29:03 zmeventnotification 20350 INF SaveTokens called with:monlist=1,5,6,7,8, intlist=0,0,0,0,0, platform=ios, push=enabled zmeventnotification.pl
2018-09-30 08:29:03 zmeventnotification 20350 INF token fdg4ExZ6jl0:APA91bHMvABosdBpawQGkCKnqEelyMuOy2tInf2rZy0MyUOfBx6EsLn-SybxCpemPcEd80JFvSRHc4DVMGdHzpXx3uvHIvDp0dBIsS1d1AhGXe4fWJVgE2L99Pufn-JmsTiJOerwXlrS matched, previously stored monlist is: 1,5,6,7,8 zmeventnotification.pl
2018-09-30 08:29:03 zmeventnotification 20350 INF overwriting fdg4ExZ6jl0:APA91bHMvABosdBpawQGkCKnqEelyMuOy2tInf2rZy0MyUOfBx6EsLn-SybxCpemPcEd80JFvSRHc4DVMGdHzpXx3uvHIvDp0dBIsS1d1AhGXe4fWJVgE2L99Pufn-JmsTiJOerwXlrS monlist with:1,5,6,7,8 zmeventnotification.pl
2018-09-30 08:29:02 zmeventnotification 20350 INF got a websocket connection from ::ffff:98.174.63.232 (1) active connections zmeventnotification.pl
2018-09-30 08:29:02 zmeventnotification 20350 INF Websockets: New Connection Handshake requested from ::ffff:98.174.63.232:50537 state=pending auth zmeventnotification.pl
2018-09-30 08:29:02 zmeventnotification 20350 INF Correct authentication provided by ::ffff:98.174.63.232 zmeventnotification.pl
2018-09-30 08:29:02 zmeventnotification 20350 INF Duplicate token found, removing old data point zmeventnotification.pl
2018-09-30 08:26:16 zmeventnotification 20350 INF Total event client connections: 1 zmeventnotification.pl
2018-09-30 08:26:16 zmeventnotification 20350 INF Loading monitors zmeventnotification.pl
2018-09-30 08:26:16 zmeventnotification 20350 INF Reloading Monitors... zmeventnotification.pl
2018-09-30 08:26:11 zmeventnotification 20350 ERR Shared data size conflict in shared_data for monitor 192.168.1.22, expected 608, got 875967096 zmeventnotification.pl
2018-09-30 08:24:06 zmeventnotification 20350 INF Secure WS(WSS) is enabled... zmeventnotification.pl
2018-09-30 08:24:06 zmeventnotification 20350 INF About to start listening to socket zmeventnotification.pl
2018-09-30 08:24:06 zmeventnotification 20350 INF Loading monitors zmeventnotification.pl
2018-09-30 08:24:06 zmeventnotification 20350 INF Reloading Monitors... zmeventnotification.pl
2018-09-30 08:24:06 zmeventnotification 20350 INF Web Socket Event Server listening on port 9000 zmeventnotification.pl
2018-09-30 08:24:05 zmeventnotification 20350 INF using config file: /etc/zmeventnotification.ini zmeventnotification.pl
2018-09-30 08:24:05 zmeventnotification 20350 INF Push enabled via FCM zmeventnotification.pl
2018-09-30 08:24:05 zmeventnotification 20350 INF Event Notification daemon v 1.2 starting zmeventnotification.pl
2018-09-30 08:24:05 zmeventnotification 20350 INF Total event client connections: 1 zmeventnotification.pl

zmNinja version:1.3.017 (ios)
ZoneMinder version:1.32.0

Sep 30, 2018 08:29:03 AM DEBUG EventCtrl:loading one more page just in case we don't have enough to display Sep 30, 2018 08:29:03 AM DEBUG EventCtrl: success, got 31 events Sep 30, 2018 08:29:03 AM DEBUG removing settings-temp-data worked Sep 30, 2018 08:29:03 AM DEBUG removing settings-temp-data worked Sep 30, 2018 08:29:03 AM DEBUG removing settings-temp-data worked Sep 30, 2018 08:29:03 AM DEBUG EventCtrl: grabbing events for: id=0 Date/Time:- Sep 30, 2018 08:29:03 AM DEBUG EventCtrl: found 10 pages of events Sep 30, 2018 08:29:03 AM DEBUG {"results":{"1":"9","5":"1","6":"4","7":"1","8":"15"}}
Sep 30, 2018 08:29:03 AM DEBUG {"results":{"1":"618","2":"86","3":"22","5":"28","6":"29","7":"101","8":"47"}}
Sep 30, 2018 08:29:03 AM DEBUG {"results":{"6":"2"}} Sep 30, 2018 08:29:03 AM DEBUG {"results":{"1":"149","5":"22","6":"28","7":"71","8":"45"}}
Sep 30, 2018 08:29:03 AM DEBUG saving defaultServerName worked Sep 30, 2018 08:29:03 AM DEBUG Real-time event: {"type":"","version":"1.2","reason":"","status":"Success","event":"auth"}
Sep 30, 2018 08:29:03 AM DEBUG saving defaultServerName worked Sep 30, 2018 08:29:03 AM DEBUG openHandShake: state of push is enabled Sep 30, 2018 08:29:03 AM INFO openHandshake: Websocket open, sending Auth Sep 30, 2018 08:29:03 AM INFO Inside openHandshake Sep 30, 2018 08:29:03 AM DEBUG saving defaultServerName worked Sep 30, 2018 08:29:03 AM DEBUG consoleEvents API:https:///api/events/consoleEvents/1%20month/AlarmFrames >=:1.json Sep 30, 2018 08:29:03 AM DEBUG consoleEvents API:https:///api/events/consoleEvents/1%20week/AlarmFrames >=:1.json Sep 30, 2018 08:29:03 AM DEBUG consoleEvents API:https:///api/events/consoleEvents/1%20day/AlarmFrames >=:1.json Sep 30, 2018 08:29:03 AM DEBUG consoleEvents API:https:///api/events/consoleEvents/1%20hour/AlarmFrames >=:1.json Sep 30, 2018 08:29:03 AM DEBUG Setting up carousel watchers Sep 30, 2018 08:29:03 AM DEBUG EventCtrl: grabbing # of event pages Sep 30, 2018 08:29:03 AM DEBUG getInitialEvents called Sep 30, 2018 08:29:03 AM DEBUG saving serverGroupList worked Sep 30, 2018 08:29:02 AM DEBUG saving serverGroupList worked Sep 30, 2018 08:29:02 AM DEBUG enabling options swipe Sep 30, 2018 08:29:02 AM DEBUG text zoom factor is 1 Sep 30, 2018 08:29:02 AM INFO ZM_EVENT_IMAGE_DIGITS is 5 Sep 30, 2018 08:29:02 AM INFO Image padding digits reported as 5 Sep 30, 2018 08:29:02 AM DEBUG Portal: Deregistering broadcast handles Sep 30, 2018 08:29:02 AM INFO ZM_EVENT_IMAGE_DIGITS is already configured for 5 Sep 30, 2018 08:29:02 AM DEBUG >>>height of list/scrub set to 330 and 370 Sep 30, 2018 08:29:02 AM DEBUG --> thumbnail means increasing row size Sep 30, 2018 08:29:02 AM INFO EventCtrl called with: E/MID=0 playEvent = false Sep 30, 2018 08:29:02 AM INFO Returning pre-loaded list of 5 monitors Sep 30, 2018 08:29:02 AM DEBUG saving serverGroupList worked Sep 30, 2018 08:29:02 AM DEBUG Transitioning state to: app.events with param {"id":"0","playEvent":"false"} Sep 30, 2018 08:29:02 AM DEBUG Setting up websocket error handler Sep 30, 2018 08:29:02 AM DEBUG Removing error handlers for websocket Sep 30, 2018 08:29:02 AM INFO Initializing Websocket with URL wss:// Sep 30, 2018 08:29:02 AM DEBUG Config URL for digits is:https:///api/configs/viewByName/ZM_EVENT_IMAGE_DIGITS.json
Sep 30, 2018 08:29:02 AM INFO Got API version: 1.32.0 Sep 30, 2018 08:29:02 AM DEBUG Setting server version to:1.32.0 Sep 30, 2018 08:29:02 AM DEBUG getAPIversion called Sep 30, 2018 08:29:02 AM DEBUG PortalLogin: auth success Sep 30, 2018 08:29:02 AM DEBUG Storing login time as Sun Sep 30 2018 08:29:02 GMT-0500 Sep 30, 2018 08:29:02 AM DEBUG auth-success broadcast:Successful Sep 30, 2018 08:29:02 AM INFO zmAutologin successfully logged into Zoneminder via API Sep 30, 2018 08:29:02 AM INFO Stream authentication construction: &auth=9562524ffc69444cfc818867da6c4042
Sep 30, 2018 08:29:02 AM DEBUG Setting server version to:1.32.0 Sep 30, 2018 08:29:02 AM DEBUG API based login returned...
Sep 30, 2018 08:29:02 AM INFO zmAutologin called Sep 30, 2018 08:29:02 AM DEBUG Resetting zmCookie...
Sep 30, 2018 08:29:02 AM DEBUG Logout returned...
Sep 30, 2018 08:29:02 AM DEBUG Logging out using API method Sep 30, 2018 08:29:02 AM INFO https://=>Logging out of any existing ZM sessions...
Sep 30, 2018 08:29:02 AM INFO Cancelling zmAutologin timer Sep 30, 2018 08:29:02 AM DEBUG PIN code entered is correct, or there is no PIN set Sep 30, 2018 08:29:02 AM DEBUG unlock called with check PIN=true Sep 30, 2018 08:29:02 AM INFO not checking for touchID Sep 30, 2018 08:29:02 AM INFO User credentials are provided Sep 30, 2018 08:29:02 AM DEBUG Inside Portal login Enter handler Sep 30, 2018 08:29:01 AM DEBUG EventCtrl: Deregistering broadcast handles Sep 30, 2018 08:29:01 AM DEBUG EventCtrl: Deregistering resize listener Sep 30, 2018 08:29:01 AM INFO Entering Portal Main Sep 30, 2018 08:29:01 AM DEBUG going to portal login Sep 30, 2018 08:29:01 AM DEBUG Last State recorded:{"viewId":"ion17","index":0,"historyId":"ion6","backViewId":null,"forwardViewId":null,"stateId":"app.events_id=0_playEvent=false","stateName":"app.events","stateParams":{"id":"0","playEvent":"false"},"url":"/app/events/0/false","canSwipeBack":true}
Sep 30, 2018 08:29:01 AM INFO App is resuming from background Sep 30, 2018 08:13:45 AM DEBUG EventCtrl Pause:Deregistering broadcast handles Sep 30, 2018 08:13:45 AM DEBUG EventCtrl:onpause called Sep 30, 2018 08:13:45 AM DEBUG Montage View Cleanup was already done, skipping Sep 30, 2018 08:13:45 AM DEBUG MontageCtrl: onpause called Sep 30, 2018 08:13:45 AM INFO Cancelling zmAutologin timer Sep 30, 2018 08:13:45 AM INFO Clearing error/close cbk, disconnecting and deleting Event Server socket...
Sep 30, 2018 08:13:45 AM INFO ROOT APP:App is going into background Sep 30, 2018 08:13:41 AM DEBUG EventCtrl:loading one more page just in case we don't have enough to display Sep 30, 2018 08:13:41 AM DEBUG EventCtrl: success, got 29 events Sep 30, 2018 08:13:41 AM DEBUG EventCtrl: grabbing events for: id=0 Date/Time:- Sep 30, 2018 08:13:41 AM DEBUG EventCtrl: found 10 pages of events Sep 30, 2018 08:13:41 AM DEBUG {"results":{"1":"149","5":"22","6":"26","7":"71","8":"45"}}
Sep 30, 2018 08:13:41 AM DEBUG {"results":[]} Sep 30, 2018 08:13:41 AM DEBUG {"results":{"1":"618","2":"86","3":"22","5":"28","6":"27","7":"101","8":"47"}}
Sep 30, 2018 08:13:41 AM DEBUG {"results":{"1":"9","5":"1","6":"2","7":"1","8":"15"}}
Sep 30, 2018 08:13:41 AM DEBUG consoleEvents API:https:///api/events/consoleEvents/1%20month/AlarmFrames >=:1.json Sep 30, 2018 08:13:41 AM DEBUG consoleEvents API:https:///api/events/consoleEvents/1%20week/AlarmFrames >=:1.json Sep 30, 2018 08:13:41 AM DEBUG consoleEvents API:https:///api/events/consoleEvents/1%20day/AlarmFrames >=:1.json Sep 30, 2018 08:13:41 AM DEBUG consoleEvents API:https:///api/events/consoleEvents/1%20hour/AlarmFrames >=:1.json Sep 30, 2018 08:13:41 AM DEBUG Setting up carousel watchers Sep 30, 2018 08:13:41 AM DEBUG EventCtrl: grabbing # of event pages Sep 30, 2018 08:13:41 AM DEBUG getInitialEvents called Sep 30, 2018 08:13:41 AM DEBUG enabling options swipe Sep 30, 2018 08:13:40 AM DEBUG text zoom factor is 1 Sep 30, 2018 08:13:40 AM INFO Image padding digits reported as 5 Sep 30, 2018 08:13:40 AM INFO ZM_EVENT_IMAGE_DIGITS is already configured for 5 Sep 30, 2018 08:13:40 AM DEBUG >>>height of list/scrub set to 330 and 370 Sep 30, 2018 08:13:40 AM DEBUG --> thumbnail means increasing row size Sep 30, 2018 08:13:40 AM INFO EventCtrl called with: E/MID=0 playEvent = false Sep 30, 2018 08:13:40 AM INFO Returning pre-loaded list of 5 monitors Sep 30, 2018 08:13:40 AM INFO Returning pre-loaded list of 5 monitors Sep 30, 2018 08:12:27 AM DEBUG doing the jiggle and dance...
Sep 30, 2018 08:12:27 AM DEBUG All images loaded, doing image layout Sep 30, 2018 08:12:27 AM INFO Arranging as per packery grid Sep 30, 2018 08:12:27 AM DEBUG All images loaded, switching to snapshot...
Sep 30, 2018 08:12:27 AM INFO Monitors that are active and not DOM hidden: 5 while grid has 5 Sep 30, 2018 08:12:27 AM INFO found a packery layout Sep 30, 2018 08:12:27 AM DEBUG removing settings-temp-data worked Sep 30, 2018 08:12:27 AM DEBUG removing settings-temp-data worked Sep 30, 2018 08:12:27 AM DEBUG removing settings-temp-data worked Sep 30, 2018 08:12:26 AM DEBUG saving defaultServerName worked Sep 30, 2018 08:12:26 AM DEBUG saving defaultServerName worked Sep 30, 2018 08:12:26 AM DEBUG saving defaultServerName worked Sep 30, 2018 08:12:26 AM DEBUG Real-time event: {"type":"","status":"Success","event":"auth","reason":"","version":"1.2"}
Sep 30, 2018 08:12:26 AM DEBUG saving serverGroupList worked Sep 30, 2018 08:12:26 AM INFO Inside Montage Ctrl:We found 5 monitors Sep 30, 2018 08:12:26 AM DEBUG skipping image refresh, packery is still loading Sep 30, 2018 08:12:26 AM DEBUG Setting up cycle interval of:10000 Sep 30, 2018 08:12:26 AM DEBUG bandwidth: highbw montage refresh set to: 2 Sep 30, 2018 08:12:26 AM DEBUG openHandShake: state of push is enabled Sep 30, 2018 08:12:26 AM INFO openHandshake: Websocket open, sending Auth Sep 30, 2018 08:12:26 AM INFO Inside openHandshake Sep 30, 2018 08:12:26 AM DEBUG Forcing simulStreams off as you have disabled it Sep 30, 2018 08:12:26 AM DEBUG Multiport=0 Sep 30, 2018 08:12:26 AM DEBUG Portal: Deregistering broadcast handles Sep 30, 2018 08:12:26 AM INFO sending Cached ZM_MIN_STREAMING_PORT 0 Sep 30, 2018 08:12:26 AM DEBUG Loading hidden/unhidden status for profile:
Sep 30, 2018 08:12:26 AM INFO multi server list loaded{"servers":[]} Sep 30, 2018 08:12:26 AM DEBUG loading saved monitor list and interval of 1,5,6,7,8>>0,0,0,0,0 Sep 30, 2018 08:12:26 AM DEBUG Loading hidden/unhidden status for profile:
Sep 30, 2018 08:12:26 AM INFO multi server list loaded{"servers":[]} Sep 30, 2018 08:12:26 AM INFO Monitor load was successful, loaded 5 monitors Sep 30, 2018 08:12:26 AM DEBUG Now trying to get multi-server data, if present Sep 30, 2018 08:12:26 AM DEBUG Inside getMonitors, will also regen connkeys Sep 30, 2018 08:12:26 AM DEBUG Loading hidden/unhidden status for profile:
Sep 30, 2018 08:12:26 AM INFO Monitor load was successful, loaded 5 monitors Sep 30, 2018 08:12:26 AM DEBUG Now trying to get multi-server data, if present Sep 30, 2018 08:12:26 AM DEBUG Inside getMonitors, will also regen connkeys Sep 30, 2018 08:12:26 AM DEBUG Loading hidden/unhidden status for profile:
Sep 30, 2018 08:12:25 AM DEBUG saving serverGroupList worked Sep 30, 2018 08:12:25 AM DEBUG Monitor URL to fetch is:https:///api/monitors/index/Type !=:WebSite.json Sep 30, 2018 08:12:25 AM DEBUG ZMS Multiport reported: 0 Sep 30, 2018 08:12:25 AM INFO ZM_MIN_STREAMING_PORT not configure, disabling Sep 30, 2018 08:12:25 AM DEBUG Setting multi-port to:false Sep 30, 2018 08:12:25 AM DEBUG Monitor URL to fetch is:https:///api/monitors/index/Type !=:WebSite.json Sep 30, 2018 08:12:25 AM DEBUG ZMS Multiport reported: 0 Sep 30, 2018 08:12:25 AM INFO ZM_MIN_STREAMING_PORT not configure, disabling Sep 30, 2018 08:12:25 AM DEBUG Setting multi-port to:false Sep 30, 2018 08:12:25 AM DEBUG Timezone API response is:America/Chicago Sep 30, 2018 08:12:25 AM INFO ZM_EVENT_IMAGE_DIGITS is 5 Sep 30, 2018 08:12:25 AM INFO Checking value of ZM_MIN_STREAMING_PORT for the first time Sep 30, 2018 08:12:25 AM INFO getMonitors:Loading all monitors Sep 30, 2018 08:12:25 AM DEBUG Push Notification registration ID received: {"registrationId":"fdg4ExZ6jl0:APA91bHMvABosdBpawQGkCKnqEelyMuOy2tInf2rZy0MyUOfBx6EsLn-SybxCpemPcEd80JFvSRHc4DVMGdHzpXx3uvHIvDp0dBIsS1d1AhGXe4fWJVgE2L99Pufn-JmsTiJOerwXlrS","registrationType":"FCM"}
Sep 30, 2018 08:12:25 AM DEBUG saving serverGroupList worked Sep 30, 2018 08:12:25 AM INFO Checking value of ZM_MIN_STREAMING_PORT for the first time Sep 30, 2018 08:12:25 AM INFO getMonitors:Loading all monitors Sep 30, 2018 08:12:25 AM DEBUG DataModel: Regenerating connkeys...
Sep 30, 2018 08:12:25 AM DEBUG Transitioning state to: app.montage with param undefined Sep 30, 2018 08:12:25 AM DEBUG Setting up websocket error handler Sep 30, 2018 08:12:25 AM DEBUG Removing error handlers for websocket Sep 30, 2018 08:12:25 AM INFO Initializing Websocket with URL wss:// Sep 30, 2018 08:12:25 AM INFO >>>Setting up push registration Sep 30, 2018 08:12:25 AM INFO First invocation of TimeZone, asking server Sep 30, 2018 08:12:25 AM DEBUG Config URL for digits is:https:///api/configs/viewByName/ZM_EVENT_IMAGE_DIGITS.json
Sep 30, 2018 08:12:25 AM INFO Got API version: 1.32.0 Sep 30, 2018 08:12:25 AM DEBUG Setting server version to:1.32.0 Sep 30, 2018 08:12:25 AM DEBUG getAPIversion called Sep 30, 2018 08:12:25 AM DEBUG PortalLogin: auth success Sep 30, 2018 08:12:25 AM DEBUG Storing login time as Sun Sep 30 2018 08:12:25 GMT-0500 Sep 30, 2018 08:12:25 AM DEBUG auth-success broadcast:Successful Sep 30, 2018 08:12:25 AM INFO zmAutologin successfully logged into Zoneminder via API Sep 30, 2018 08:12:25 AM INFO Stream authentication construction: &auth=9562524ffc69444cfc818867da6c4042
Sep 30, 2018 08:12:25 AM DEBUG Setting server version to:1.32.0 Sep 30, 2018 08:12:25 AM DEBUG API based login returned...
Sep 30, 2018 08:12:25 AM INFO zmAutologin called Sep 30, 2018 08:12:25 AM DEBUG Resetting zmCookie...
Sep 30, 2018 08:12:25 AM DEBUG Logout returned...
Sep 30, 2018 08:12:24 AM DEBUG Logging out using API method Sep 30, 2018 08:12:24 AM INFO https://=>Logging out of any existing ZM sessions...
Sep 30, 2018 08:12:24 AM INFO Cancelling zmAutologin timer Sep 30, 2018 08:12:24 AM DEBUG PIN code entered is correct, or there is no PIN set Sep 30, 2018 08:12:24 AM DEBUG unlock called with check PIN=true Sep 30, 2018 08:12:24 AM INFO not checking for touchID Sep 30, 2018 08:12:24 AM INFO User credentials are provided Sep 30, 2018 08:12:24 AM DEBUG Inside Portal login Enter handler Sep 30, 2018 08:12:24 AM DEBUG Latest post dated 2018-09-25 15:25:13 but you read 2018-09-25 15:25:13 Sep 30, 2018 08:12:24 AM DEBUG current version: 1.3.017 & available version 1.3.018 Sep 30, 2018 08:12:24 AM INFO Entering Portal Main Sep 30, 2018 08:12:23 AM INFO Inside init-complete in app.js: All init over, going to portal login Sep 30, 2018 08:12:23 AM INFO >>>> Disabling strict SSL checking (turn off in Dev Options if you can't connect) Sep 30, 2018 08:12:23 AM INFO DataModel init retrieved store loginData Sep 30, 2018 08:12:23 AM INFO SlowDelay is: false Sep 30, 2018 08:12:23 AM INFO Setting DataModel init bandwidth to: highbw Sep 30, 2018 08:12:23 AM DEBUG timeline graph type not set. Setting to all Sep 30, 2018 08:12:23 AM INFO user profile encrypted, decoding...
Sep 30, 2018 08:12:23 AM INFO Setting up pause and resume handler AFTER language is loaded...
Sep 30, 2018 08:12:23 AM INFO Setting up POST LOGIN timer Sep 30, 2018 08:12:23 AM INFO Checking for news updates Sep 30, 2018 08:12:23 AM INFO Checking for new version updates...
Sep 30, 2018 08:12:23 AM INFO ZMData init: checking for stored variables & setting up log file Sep 30, 2018 08:12:23 AM INFO Language file loaded, continuing with rest Sep 30, 2018 08:12:23 AM DEBUG isFirstUse returned: false Sep 30, 2018 08:12:23 AM INFO >>>>Language to be used:en Sep 30, 2018 08:12:23 AM INFO Device Language is:en Sep 30, 2018 08:12:23 AM INFO No language set, switching to en Sep 30, 2018 08:12:23 AM INFO App Version: 1.3.017 Sep 30, 2018 08:12:23 AM INFO Retrieving language before init is called...
Sep 30, 2018 08:12:23 AM INFO Enabling native transitions...
Sep 30, 2018 08:12:23 AM INFO Updating statusbar Sep 30, 2018 08:12:23 AM INFO >>>>No data to import....
Sep 30, 2018 08:12:23 AM INFO localforage driver for storage:cordovaSQLiteDriver Sep 30, 2018 08:12:23 AM DEBUG configureStorageDB:test get/set worked, this driver is ok...
Sep 30, 2018 08:12:23 AM DEBUG text zoom factor is 1 Sep 30, 2018 08:12:23 AM DEBUG configureStorageDB:Making sure this storage driver works...
Sep 30, 2018 08:12:23 AM INFO configureStorageDB:localforage driver for storage:cordovaSQLiteDriver Sep 30, 2018 08:12:23 AM DEBUG configureStorageDB: trying order:["cordovaSQLiteDriver","asyncStorage","localStorageWrapper"]
Sep 30, 2018 08:12:23 AM DEBUG Inside configureStorageDB Sep 30, 2018 08:12:23 AM INFO You are running on ios Sep 30, 2018 08:12:23 AM INFO Device is ready Sep 29, 2018 07:51:43 PM DEBUG State results: {"data":{"states":[{"State":{"Id":"1","Name":"default","Definition":"","IsActive":"0"}},{"State":{"Id":"8","Name":"Monitor","Definition":"1:Monitor:1,5:Monitor:1,6:Monitor:1,7:Monitor:1,8:Monitor:1","IsActive":"1"}},{"State":{"Id":"9","Name":"Mocord","Definition":"1:Mocord:1,5:Mocord:1,6:Mocord:1,7:Mocord:1,8:Mocord:1","IsActive":"0"}},{"State":{"Id":"10","Name":"Nighttime","Definition":"1:Modect:1,5:Modect:1,6:Modect:1,7:Modect:1,8:Modect:1","IsActive":"0"}},{"State":{"Id":"12","Name":"Away","Definition":"1:Modect:1,5:Modect:1,6:Modect:1,7:Modect:1,8:Modect:1","IsActive":"0"}}]},"status":200,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"https:///api/States.json","headers":{"Accept":"application/json, text/plain, /"}},"statusText":"OK"} Sep 29, 2018 07:51:43 PM DEBUG StateCtrl: getting state using https:///api/States.json Sep 29, 2018 07:51:42 PM DEBUG StateCtrl/controlZM: returned success Sep 29, 2018 07:51:30 PM INFO Websocket closed Sep 29, 2018 07:51:27 PM DEBUG StateCtrl/controlZM: POST Control command is https:///api/states/change/Monitor.json
Sep 29, 2018 07:51:27 PM DEBUG inside performZMoperation with Monitor Sep 29, 2018 07:51:20 PM INFO List of custom states: ["default","Monitor","Mocord","Nighttime","Away"]
Sep 29, 2018 07:51:13 PM DEBUG State results: {"data":{"states":[{"State":{"Id":"1","Name":"default","Definition":"","IsActive":"0"}},{"State":{"Id":"8","Name":"Monitor","Definition":"1:Monitor:1,5:Monitor:1,6:Monitor:1,7:Monitor:1,8:Monitor:1","IsActive":"0"}},{"State":{"Id":"9","Name":"Mocord","Definition":"1:Mocord:1,5:Mocord:1,6:Mocord:1,7:Mocord:1,8:Mocord:1","IsActive":"0"}},{"State":{"Id":"10","Name":"Nighttime","Definition":"1:Modect:1,5:Modect:1,6:Modect:1,7:Modect:1,8:Modect:1","IsActive":"0"}},{"State":{"Id":"12","Name":"Away","Definition":"1:Modect:1,5:Modect:1,6:Modect:1,7:Modect:1,8:Modect:1","IsActive":"1"}}]},"status":200,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"https:///api/States.json","headers":{"Accept":"application/json, text/plain, /"}},"statusText":"OK"} Sep 29, 2018 07:51:13 PM DEBUG StateCtrl: getting state using https:///api/States.json Sep 29, 2018 07:51:13 PM DEBUG invoking CurrentState...
Sep 29, 2018 07:51:11 PM DEBUG StateCtrl/getLoadStatus: success Sep 29, 2018 07:51:11 PM DEBUG Load results: {"data":{"load":[0.63,0.61,0.57]},"status":200,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"https:///api/host/getLoad.json","headers":{"Accept":"application/json, text/plain, /"},"timeout":30000},"statusText":"OK"}
Sep 29, 2018 07:51:11 PM DEBUG StateCtrl/getLoadStatus: https:///api/host/getLoad.json Sep 29, 2018 07:51:11 PM DEBUG invoking LoadStatus...
Sep 29, 2018 07:51:10 PM DEBUG Run results: {"data":{"result":1},"status":200,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"url":"https:///api/host/daemonCheck.json","headers":{"Accept":"application/json, text/plain, /"},"timeout":30000},"statusText":

Auth problem

I test the event server via windows 64bits.
This is my logs:
Feb 10 13:35:56 Serveur-Pro zmeventnotification[22572]: INF [Push enabled via FCM]
Feb 10 13:35:56 Serveur-Pro zmeventnotification[22572]: INF [Event Notification daemon v 0.98.3 starting]
Feb 10 13:35:56 Serveur-Pro zmeventnotification[22572]: INF [Total event client connections: 0]
Feb 10 13:35:56 Serveur-Pro zmeventnotification[22572]: INF [Reloading Monitors...]
Feb 10 13:35:56 Serveur-Pro zmeventnotification[22572]: INF [Loading monitors]
Feb 10 13:35:56 Serveur-Pro zmeventnotification[22572]: INF [About to start listening to socket]
Feb 10 13:35:56 Serveur-Pro zmeventnotification[22572]: INF [Secure WS(WSS) is enabled...]
Feb 10 13:35:56 Serveur-Pro zmeventnotification[22572]: INF [Web Socket Event Server listening on port 9000]
Feb 10 13:36:02 Serveur-Pro zmeventnotification[22572]: INF [got a websocket connection from 78.224.165.22 (0) active connections]
Feb 10 13:36:02 Serveur-Pro zmeventnotification[22572]: INF [Websockets: New Connection Handshake requested from 78.224.x.x:59386 state=pending auth]
Feb 10 13:36:03 Serveur-Pro zmeventnotification[22572]: INF [Contrl: Storing token ...,monlist:1,intlist:0,pushstate:]
Feb 10 13:36:03 Serveur-Pro zmeventnotification[22572]: INF [Bad authentication provided by 78.224.165.22]

Feb 10, 2018 01:37 PM DEBUG Saving Event Server data
Feb 10, 2018 01:36 PM INFO Event Error: {"type":"","event":"auth","status":"Fail","reason":"BADAUTH"}
Feb 10, 2018 01:36 PM DEBUG Real-time event: {"type":"","event":"auth","status":"Fail","reason":"BADAUTH"}
Feb 10, 2018 01:36 PM INFO openHandshake: Websocket open, sending Auth
Feb 10, 2018 01:36 PM INFO Inside openHandshake
Feb 10, 2018 01:36 PM DEBUG Sending Control message 'filter' with monlist=1 and interval=0
Feb 10, 2018 01:36 PM DEBUG Setting up websocket error handler
Feb 10, 2018 01:36 PM INFO Initializing Websocket with URL wss://...:9000
Feb 10, 2018 01:36 PM INFO Desktop instance, not setting up push. Websockets only, I hope
Feb 10, 2018 01:36 PM INFO >>>Setting up push registration
'
my $useSecure = 1; # make this 0 if you don't want SSL
my $noAuth = 0; # make 1 to NOT check username/password against zoneminder Database

ignore if useSecure is 0

use constant SSL_CERT_FILE=>'/etc/letsencrypt/live/.../cert.pem'; # Change these to your certs/keys
use constant SSL_KEY_FILE=>'/etc/letsencrypt/live/.../privkey.pem';
`

Support for IPv6 dualstack

I was setting up the ZM event server and noticed that it currently does response to IPv6.

Can IPv6 support be added in?

Minor README.md corrections

First of all a great README for a beginner as me and I have zmeventnotification up and running (want it to link with openhab TCP plugin, but I still have other problems with that plugin, but I see events in the zoneminder log file from zmeventnotification as required).

As I followed the installation guide step by step I discovered some corrections which I wanted to share as it may help other beginners. Comments with a '+' were my biggest problems:
under How do I install it:

  • "Download zmeventnotification.ini" it isn't mentioned were to place it (should be /etc). 'zmeventnotification.pl is proposed to move to /usr/bin in this paragraph.
  • Before I could add the perl modules, I had to install 'make' and 'gcc' (to install 'make' there is a note under "Next up install Websockets", but it's required earlier when you use the "sudo perl -MCPAN -e shell" option as I did. (It confused me that perl required additional non-perl modules installed)
  • "apt-get install libjson-perl" and "perl -MCPAN -e "install LWP::Protocol::https" require sudo

  • Then under "Making sure everything is running" it's stated "sudo -u www-data ./zmeventnotification.pl --config ./zmeventnotification.ini". This in contradiction with the beginning of the installation guide were it's proposed to move 'zmeventnotification.pl' into /usr/bin.

  • Alternativelly the statement to move 'zmeventnotification.pl' to /usr/bin could be removed as it's also mentioned later in this paragraph.

  • Under "Running it as demo" the commands below also require sudo.

  • More serious here is that the link to 'zmpkg.pl' modification doesn't work (not sure if I did it correct but added the proposed 'runCommand' in the if statement and before 'zmfilter.pl runCommand' line. It seems to work.
  • In "Understanding zmeventnotification" it also shows the address, but this is a real minor point ;-)

syntax error: newline unexpected

Im a little outside my knowledge on this one. When i run the command below i get the error at the bottom.

sudo /usr/bin/zmeventnotification.pl

/usr/bin/zmeventnotification.pl: 6: /usr/bin/zmeventnotification.pl: Syntax error: newline unexpected

cannot get zmNinja to connect

I cannot get zmNinja to connect to the event server but there is not much to debug in the logs. SSL is disabled (I don't feel like having my priv key readable by www-data) and the connection seems to start, but is immediately lost.

zmNinja 1.2.515 for android (upside down):

Jan 14, 2018 12:29 AM INFO Websocket closed
Jan 14, 2018 12:29 AM INFO Will try to reconnect in 10 sec..
Jan 14, 2018 12:29 AM DEBUG -->Forcing socket close
Jan 14, 2018 12:29 AM DEBUG Websocket Errorhandler called
Jan 14, 2018 12:29 AM DEBUG Sending token state enabled
Jan 14, 2018 12:29 AM DEBUG Sending Control message 'filter' with monlist=5 and interval=0
Jan 14, 2018 12:29 AM DEBUG Setting up websocket error handler
Jan 14, 2018 12:29 AM INFO Initializing Websocket with URL ws://
Jan 14, 2018 12:29 AM DEBUG Saving Event Server data

Server side (debian stretch):

zmeventnotification[4201]: INF [Push enabled via FCM]
zmeventnotification[4201]: INF [Event Notification daemon v 0.98.3 starting]
zmeventnotification[4201]: INF [Total event client connections: 0]
zmeventnotification[4201]: INF [Reloading Monitors...]
zmeventnotification[4201]: INF [Loading monitors]
zmeventnotification[4201]: INF [Secure WS is disabled...]
zmeventnotification[4201]: INF [Web Socket Event Server listening on port 9000]
zmeventnotification[4201]: INF [got a websocket connection from xx.xxx.79.21 (0) active connections]
zmeventnotification[4201]: INF [Websocket remotely disconnected from xx.xxx.79.21]

zmeventserver email event

Hi,
I would like to use zmeventserver to export the event in zip and email the event.
Is that posible? How to identify the event directory?

Lutfi

Config::Inifiles missing

I have placed the zmeventnotification.ini file in /etc but still getting the error "Config::Inifiles missing".
Does the file need to change the owner to www-data?

Net::WebSocket::Server missing

I'm sure this is my fault, as I am in a little over my head. I get there error when manually starting zmeventnotification.pl:

Apr 30 16:18:02 debian zma[1406]: INF [DCS5020L: 23000 - Analysing at 29.41 fps]
Apr 30 16:18:34 debian zmc[1403]: INF [DCS5020L: 24000 - Capturing at 30.30 fps]
Apr 30 16:18:36 debian zma[1406]: INF [DCS5020L: 24000 - Analysing at 29.41 fps]
Apr 30 16:18:48 debian web_php[1477]: INF [Login successful for user "admin"]
Apr 30 16:18:50 debian web_php[1482]: ERR [socket_sendto( /var/run/zm/zms-174204s.sock ) failed: No such file or directory]
Apr 30 16:19:08 debian zmc[1403]: INF [DCS5020L: 25000 - Capturing at 29.41 fps]
Apr 30 16:19:11 debian zma[1406]: INF [DCS5020L: 25000 - Analysing at 29.41 fps]
Apr 30 16:19:39 debian zmeventnotification[1771]: FAT [Net::WebSocket::Server missing]
Apr 30 16:19:42 debian zmc[1403]: INF [DCS5020L: 26000 - Capturing at 29.41 fps]
Apr 30 16:19:44 debian zma[1406]: INF [DCS5020L: 26000 - Analysing at 29.41 fps]

I followed your readme.md exactly, the .crt is on my phone and installed. For now I'm just using the local IP from within my house trying to get everything working.

Can't Start Eventnotification

OK lets start this over. I have got further but here is where it keeps hanging up the logs
I am only for now running this local in my LAN to test. NO SSL and not pushing to your proxy yet.
I don't get any alarms pushed and /etc/private/tokens.txt is 777 owner group www-data:www-data

2016-08-26 12:26:43.395390 zmeventnotification 4057 INF Correct authentication provided by 192.168.2.151 zmeventnotification.pl
2016-08-26 12:26:43.364800 zmeventnotification 4057 INF Websockets: New Connection Handshake requested from 192.168.2.151:44623 state=pending auth zmeventnotification.pl
2016-08-26 12:26:43.361070 zmeventnotification 4057 INF got a websocket connection from 192.168.2.151 (0) active connections zmeventnotification.pl
2016-08-26 12:26:38.328850 zmeventnotification 4057 INF Marking 192.168.2.151 for deletion as websocket closed remotely zmeventnotification.pl
2016-08-26 12:26:38.324910 zmeventnotification 4057 INF Websocket remotely disconnected from 192.168.2.151 zmeventnotification.pl
2016-08-26 12:26:38.323180 zmeventnotification 4057 INF Rejecting 192.168.2.151 - authentication timeout zmeventnotification.pl
2016-08-26 12:26:34.147060 zmeventnotification 4057 INF Contrl: Storing token ...,monlist:3,6,5,intlist:1,1,1,pushstate: zmeventnotification.pl
2016-08-26 12:26:16.961430 zmeventnotification 4057 INF Websockets: New Connection Handshake requested from 192.168.2.151:44615 state=pending auth

Not receiving MQTT messages

I'm running the perl file and getting output that makes me think it comprehends the events that are coming out of zoneminder server (on the same physical machine). I'm not seeing the messages on the MQTT broker on another computer in the same network.

An excerpt from a config-check:

Use MQTT .......................true
MQTT Server ....................192.168.1.200
MQTT Username ..................manion
MQTT Password ..................(defined)

Zoneminder (and the event notification script) run on a physical machine with IP address 192.168.1.240 and the MQTT broker is at 192.168.1.200.

An excerpt from the log.

2018-10-18,19:19:01 ---------->Tick START<--------------
2018-10-18,19:19:01 After tick: TOTAL: 0, VALID_WEBSOCKET: 0, INVALID_WEBSOCKET: 0, PENDING_AUTH: 0
2018-10-18,19:19:01 New event 721854 reported for Porch Motion Driveway,

10/18/2018 19:19:01.406720 zmeventnotification[6476].INF [main:539] [New event 721854 reported for Porch Motion Driveway,]
2018-10-18,19:19:01 New event 721853 reported for Driveway Motion New,New,

10/18/2018 19:19:01.419629 zmeventnotification[6476].INF [main:539] [New event 721853 reported for Driveway Motion New,New,]
2018-10-18,19:19:01 ---------->Tick END<--------------
2018-10-18,19:19:01 Forking process:6502 to handle alarm for:721853 monitor:Driveway
10/18/2018 19:19:01.430320 zmeventnotification[6502].INF [main:539] [Forking process:6502 to handle alarm for:721853 monitor:Driveway]
2018-10-18,19:19:01 Sending notification over MQTT
10/18/2018 19:19:01.437530 zmeventnotification[6502].INF [main:539] [Sending notification over MQTT]
2018-10-18,19:19:01 Broadcasting new events to all 0 websocket clients

10/18/2018 19:19:01.445512 zmeventnotification[6502].INF [main:539] [Broadcasting new events to all 0 websocket clients]
2018-10-18,19:19:01 Ending process to handle alarm for:721853 monitor:Driveway
10/18/2018 19:19:01.452521 zmeventnotification[6502].INF [main:539] [Ending process to handle alarm for:721853 monitor:Driveway]

The script is detecting the ZM events and it says it is sending the MQTT messages, but I'm not seeing them on the other end (listening to topics zoneminder/# and /zoneminder/#).

Am I listening to the right topic?

MQTT events are being concatenated

First, thanks for making this extensible framework available as well as your relatively recent blog posting on object detection! I'm using MQTT to integrate with home-assistant and essentially develop a perimeter alarm based on MQTT binary sensors. I do have cameras that overlap (opposing angles) certain zones, so the likelihood that 2 or more events occur within the event server's monitor polling period is happening and will continue to happen if not within a few seconds, simultaneously in some cases. I noticed that when this happens, home-assistant does not receive updates for those topics, so I decided to subscribe to the broker to see what's going on:

Single monitor has registered an event and binary_sensor updated:

zoneminder/8 {"state":"alarm","name":"Alarms: Front Side Entrance Motion Door,  (7692) ","monitor":"8"}

2 monitors have registered events and neither binary_sensor is updated:

zoneminder/8,7 {"name":"Alarms: Front Side Entrance Motion Driveway,  (7694) ,Front Alley - Right Motion Walkway,  (7693) ","state":"alarm","monitor":"8,7"}

I could be wrong, being an MQTT newb, but from what I've read, pubs should occur per topic, while a sub can listen based on wildcards. Since there's no specific listener for 'zoneminder/8,7' the event is dropped on the floor. I could probably address this in home-assistant in some roundabout way, but I feel like the event server should be updated to emit one notification per topic. I'd submit a pull request for the change, but alas, python and ruby are my go-to languages and perl is just not in my vernacular. Nonetheless, I hacked up a change (really awful) to the 'sendOverMQTTBroker' function to split up monitor ID's and the header info and emit 1 notification per monitor event via the appropriate and specific topic.

Thoughts?

Events constantly sending - not waiting for 'mint', log always says "last time not found, so sending"

For the past month or so every event that occurs is being sent to ZMNinja, ignoring the 'minimum interval' setting. The log always shows "last time not found, so sending" despite an event being sent previously.

zmeventserver.log

Steps to reproduce:

  • Set up notifications in ZMNinja
  • Set minimum interval to some value ('300' for example)
  • Go wave at a camera - a push notification is correctly sent
  • Wait a couple of seconds
  • Go wave at a camera again - another push notification is sent, despite it being much too soon

Expected behaviour:

  • Events shouldn't be sent unless they occur after the minimum interval has expired

Troubleshooting steps taken:

  • Upgraded zmeventserver to latest version (git clone today - Oct 30)
  • Manually stopped the zmeventserver, removed token file, restarted
  • Disabled / saved / enabled event server in ZMNinja

zmeventserver won't start after logInit();

I'm trying to install zmeventserver.
I've edited the config and disabled the ssl option for testing.
When i'm starting the server from root then i only see this entry in syslog:

Jan 12 18:33:04 cams zmeventnotification[20780]: INF [Push enabled via FCM]

When i comment out logInit();
then i loads fully and i see:

Jan 12 17:54:03 cams zmeventnotification[19665]: INF [Push enabled via FCM] Jan 12 17:54:03 cams zmeventnotification[19665]: INF [Event Notification daemon v 0.98.3 starting] Jan 12 17:54:03 cams zmeventnotification[19665]: INF [Total event client connections: 1] Jan 12 17:54:03 cams zmeventnotification[19665]: INF [Reloading Monitors...] Jan 12 17:54:03 cams zmeventnotification[19665]: INF [Loading monitors] Jan 12 17:54:03 cams zmeventnotification[19665]: INF [Secure WS is disabled...] Jan 12 17:54:03 cams zmeventnotification[19665]: INF [Web Socket Event Server listening on port 9000]

From what i can see logInit(); is an zoneminder function.
Can you help me?

zmeventnotification.pl runs from command-line but not via zmdc.pl/zmpkg.pl

Running zmeventnotification.pl from a separate terminal everything works fine and events are sent to zmNinja running on my phone. Zoneminder works, streaming works and SSL/HTTPS is setup with certbot (Letsencrypt). This is what I get from syslog:

Dec 25 22:29:06 rpi2 zmeventnotification[2547]: INF [Push enabled via PushProxy]
Dec 25 22:29:06 rpi2 zmeventnotification[2547]: INF [direct APNS disabled]
Dec 25 22:29:06 rpi2 zmeventnotification[2547]: INF [Event Notification daemon v 0.92 starting]
Dec 25 22:29:06 rpi2 zmeventnotification[2547]: INF [Total event client connections: 1]
Dec 25 22:29:06 rpi2 zmeventnotification[2547]: INF [Reloading Monitors...]
Dec 25 22:29:06 rpi2 zmeventnotification[2547]: INF [Loading monitors]
Dec 25 22:29:06 rpi2 zmeventnotification[2547]: INF [Checking https://185.124.74.36:8801 reachability...]
Dec 25 22:29:07 rpi2 zmeventnotification[2547]: INF [PushProxy https://185.124.74.36:8801 is reachable.]
Dec 25 22:29:07 rpi2 zmeventnotification[2547]: INF [About to start listening to socket]
Dec 25 22:29:07 rpi2 zmeventnotification[2547]: INF [Secure WS(WSS) is enabled...]
Dec 25 22:29:07 rpi2 zmeventnotification[2547]: INF [Web Socket Event Server listening on port 9000]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [got a websocket connection from 192.168.0.7 (1) active connections]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [Websocket remotely disconnected from 192.168.0.7]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [got a websocket connection from 192.168.0.7 (1) active connections]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [Websockets: New Connection Handshake requested from 192.168.0.7:43394 state=pending auth]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [Correct authentication provided by 192.168.0.7]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [Storing token ...SlqEDZnVbm,monlist:1,intlist:0,pushstate:enabled]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [SaveTokens called with:monlist=1, intlist=0, platform=android, push=enabled]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [da-0IAjxvLA:APA91bGx(edited token) not found, creating new record with monlist=1]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [Pushproxy registration success ]
Dec 25 22:45:09 rpi2 zmeventnotification[2547]: INF [Pushproxy registration success ]
Dec 25 22:45:29 rpi2 zma_m1[2752]: INF [Kitchen: 2000 - Analysing at 11.90 fps]
Dec 25 22:45:31 rpi2 zma_m1[2752]: INF [Kitchen: 2030 - Gone into alarm state]
Dec 25 22:45:31 rpi2 zma_m1[2752]: INF [Kitchen: 2030 - Opening new event 634, alarm start]
Dec 25 22:45:32 rpi2 zma_m1[2752]: INF [Kitchen: 2031 - Gone into alert state]
Dec 25 22:45:32 rpi2 zmeventnotification[2547]: INF [New event 634 reported for Kitchen]
Dec 25 22:45:32 rpi2 zmeventnotification[2547]: INF [Broadcasting new events to all 2 websocket clients]
Dec 25 22:45:32 rpi2 zmeventnotification[2547]: INF [Checking alarm rules for token ending in:...a-0IAjxvLA]
Dec 25 22:45:32 rpi2 zmeventnotification[2547]: INF [Checking alarm rules for 192.168.0.7:43394 token ending in:...SlqEDZnVbm]
Dec 25 22:45:32 rpi2 zmeventnotification[2547]: INF [Monitor 1 event: last time not found, so sending]
Dec 25 22:45:32 rpi2 zmeventnotification[2547]: INF [Sending notification over PushProxy]
Dec 25 22:45:33 rpi2 zmeventnotification[2547]: INF [Pushproxy push message success ]
Dec 25 22:45:33 rpi2 zmeventnotification[2547]: INF [192.168.0.7-sending supplementary data over websockets]
Dec 25 22:45:35 rpi2 zma_m1[2752]: INF [Kitchen: 2056 - Left alarm state (634) - 51(1) images]
Dec 25 22:45:35 rpi2 zma_m1[2752]: INF [Kitchen: 2056 - Closing event 634, alarm end]
Dec 25 22:45:39 rpi2 zma_m1[2752]: INF [Kitchen: 2100 - Gone into alarm state]
Dec 25 22:45:39 rpi2 zma_m1[2752]: INF [Kitchen: 2100 - Opening new event 635, alarm start]
Dec 25 22:45:41 rpi2 zma_m1[2752]: INF [Kitchen: 2105 - Gone into alert state]
Dec 25 22:45:41 rpi2 zma_m1[2752]: INF [Kitchen: 2107 - Gone back into alarm state]
Dec 25 22:45:42 rpi2 zma_m1[2752]: INF [Kitchen: 2109 - Gone into alert state]
Dec 25 22:45:42 rpi2 zmeventnotification[2547]: INF [New event 635 reported for Kitchen]
Dec 25 22:45:42 rpi2 zmeventnotification[2547]: INF [Broadcasting new events to all 2 websocket clients]
Dec 25 22:45:42 rpi2 zmeventnotification[2547]: INF [Checking alarm rules for token ending in:...a-0IAjxvLA]
Dec 25 22:45:42 rpi2 zmeventnotification[2547]: INF [Checking alarm rules for 192.168.0.7:43394 token ending in:...SlqEDZnVbm]
Dec 25 22:45:42 rpi2 zmeventnotification[2547]: INF [Monitor 1 event: sending this out as 10 is >= interval of 0]
Dec 25 22:45:42 rpi2 zmeventnotification[2547]: INF [Sending notification over PushProxy]
Dec 25 22:45:42 rpi2 zmeventnotification[2547]: INF [Pushproxy push message success ]
Dec 25 22:45:42 rpi2 zmeventnotification[2547]: INF [192.168.0.7-sending supplementary data over websockets]
Dec 25 22:45:45 rpi2 zma_m1[2752]: INF [Kitchen: 2134 - Left alarm state (635) - 59(7) images]
Dec 25 22:45:45 rpi2 zma_m1[2752]: INF [Kitchen: 2134 - Closing event 635, alarm end]
Dec 25 22:46:31 rpi2 zmc_m1[2119]: INF [Kitchen: 34000 - Capturing at 12.05 fps]

However, when starting zmeventnotification.pl from within zmdc.pl/zmpkg.pl (by following instructions in README.md) it crashes and syslog shows this:

Dec 25 21:54:16 rpi2 zmdc[1650]: INF [Starting pending process, zmeventnotification.pl]
Dec 25 21:54:16 rpi2 zmdc[1650]: INF ['zmeventnotification.pl' starting at 16/12/25 21:54:16, pid = 1873]
Dec 25 21:54:16 rpi2 zmdc[1873]: INF ['zmeventnotification.pl' started at 16/12/25 21:54:16]
Dec 25 21:54:18 rpi2 zmeventnotification[1873]: INF [Push enabled via PushProxy]
Dec 25 21:54:19 rpi2 zmeventnotification[1873]: INF [direct APNS disabled]
Dec 25 21:54:19 rpi2 zmeventnotification[1873]: INF [Event Notification daemon v 0.92 starting]
Dec 25 21:54:19 rpi2 zmeventnotification[1873]: INF [Total event client connections: 1]
Dec 25 21:54:19 rpi2 zmeventnotification[1873]: INF [Reloading Monitors...]
Dec 25 21:54:19 rpi2 zmeventnotification[1873]: INF [Loading monitors]
Dec 25 21:54:19 rpi2 zmeventnotification[1873]: INF [Checking https://185.124.74.36:8801 reachability...]
Dec 25 21:54:20 rpi2 zmeventnotification[1873]: INF [PushProxy https://185.124.74.36:8801 is reachable.]
Dec 25 21:54:20 rpi2 zmeventnotification[1873]: INF [About to start listening to socket]
Dec 25 21:54:20 rpi2 zmdc[1650]: ERR ['zmeventnotification.pl' exited abnormally, exit status 9]

Any ideas? Running on raspberry pi 2, raspbian, apache2 (2.4.23-8) and Zoneminder (1.30.0+dfsg-1).

daft question

Hi there,

Daft question, when I run this (as sudo) , it simply comes back , no errors, nothing. and nothing appears to be running in the background.
Am I missing something? how do I debug perl?

Settting up Real Time Alerts/Notifications with ZMninja

Platform & OS Version
-Server:Ubuntu 16.04
Phone:Iphone 6s
-ZMninja version:1.1.96

Device details:
I am trying to set up Real time alerts, but I am getting some errors

Step1:
I follow these steps below

"Copy zmeventnotification.pl to /usr/bin
Edit /usr/bin/zmdc.pl and in the array @daemons (starting line 80) add 'zmeventnotification.pl' like this
Edit /usr/bin/zmpkg.pl and around line 260, right after the comment that says #this is now started unconditionally and right before the line that says runCommand( "zmdc.pl start zmfilter.pl" ); start zmeventnotification.pl by adding runCommand( "zmdc.pl start zmeventnotification.pl" ); like this
Make sure you restart ZM. Rebooting the server is better - sometimes zmdc hangs around and you'll be wondering why your new daemon hasn't started
To check if its running do a zmdc.pl status zmeventnotification.pl"

link: https://github.com/pliablepixels/zmeventserver

Step 2: Once I executed this line zmdc.pl status zmeventnotification.pl, below you can see the errors I am getting

"Can't open config file '/etc/zm/zm.conf': Permission denied at /usr/share/perl5/ZoneMinder/Config.pm line 119.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 119.
Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.
Compilation failed in require at /usr/bin/zmdc.pl line 65.
BEGIN failed--compilation aborted at /usr/bin/zmdc.pl line 65."

Details
I am just having issues configuring real time alerts. I am not sure what I need to do next. It seems that I have a permission problem, but I don't know what to do next or where to start.. need step by step help.

I also need confirmation that the steps ( step1 instructions) I am following are correct for this set up. I may be doing this all wrong.

Note: My system is working and operational as we speak. I just need to enable real time notifications so I can receive them on my phone while alerts pop up.

Thanks!
Robert

Install on Centos 6.x

What would be the install procedure once CentOS 6.x please? Specifically the perl dependencies for the naming conventions and availabilities are very different from Debian based systems.

TIA

Very nice addition to my Docker

I added your notification server to my Zoneminder Docker and I have to say it is a very nice feature for iOS and Andriod devices. Good job! Thank you.

filter for event push

Looking to see if I can limit the event pushes to a filter event much like the email. I am getting a lot of signal lost and very small change events coming through that I would love to filter before they are pushed.

Cannot get secure connections to work in iOS 11.1.2

I have zmNinja working with insecure connections, but am not able to get it to work over wss. My certificate is generated via cacert.org and I have made sure that the domain name of my ZM server is correctly reflected in the certificate.

I have added the certificate to my phone as described, but it shows up as "Not Verified" and did not enable me to use the secure socket. I have also installed a profile containing the certificate but that also did not help.

Any help would be greatly appreciated!

ZMEventServer running but no events being received by client

Hi there
(Decided to open a new ticket to keep the issues separate)

As discussed before, have installed zmeventnotification.pl and it now runs without returning. Chrome SimpleWebSocket Client in non secure mode, also tried with another websocket client

If I force an event I sometimes receive ONE event, but more often nothing..
Syslog here #baffled

Oct 4 16:48:05 virgo zmeventnotification[7857]: INF [got a websocket connection from 192.168.0.18 (1) active connections]
Oct 4 16:48:05 virgo zmeventnotification[7857]: INF [Websockets: New Connection Handshake requested from 192.168.0.18:38971 state=pending auth]
Oct 4 16:48:06 virgo zmeventnotification[7857]: INF [Correct authentication provided by 192.168.0.18]
Oct 4 16:48:07 virgo zmc_dvideo0[1891]: INF [CarCam: 647000 - Capturing at 25.00 fps]
Oct 4 16:48:07 virgo zma_m6[1894]: INF [CarCam: 636000 - Analysing at 22.73 fps]
Oct 4 16:48:15 virgo zma_m6[1894]: INF [CarCam: 636206 - Gone into alarm state]
Oct 4 16:48:29 virgo zma_m6[1894]: INF [CarCam: 636363 - Gone into alert state]
Oct 4 16:48:30 virgo zma_m6[1894]: INF [CarCam: 636388 - Left alarm state (31652) - 10766(1321) images]
Oct 4 16:48:47 virgo zmc_dvideo0[1891]: INF [CarCam: 648000 - Capturing at 25.00 fps]
Oct 4 16:48:55 virgo zma_m6[1894]: INF [CarCam: 637000 - Analysing at 20.83 fps]
Oct 4 16:49:14 virgo zmc_m1[1893]: INF [Kitchencam: 78000 - Capturing at 3.02 fps]
Oct 4 16:49:16 virgo zma_m1[1941]: INF [Kitchencam: 78000 - Analysing at 3.03 fps]
Oct 4 16:49:27 virgo zmc_dvideo0[1891]: INF [CarCam: 649000 - Capturing at 25.00 fps]
Oct 4 16:49:35 virgo zma_m6[1894]: INF [CarCam: 638000 - Analysing at 25.00 fps]
Oct 4 16:50:00 virgo zma_m6[1894]: INF [CarCam: 638611 - Closing event 31652, section end]
Oct 4 16:50:00 virgo zma_m1[1941]: INF [Kitchencam: 78130 - Closing event 31653, section end]
Oct 4 16:50:00 virgo zma_m6[1894]: INF [CarCam: 638611 - Opening new event 31654, section start]
Oct 4 16:50:00 virgo zma_m1[1941]: INF [Kitchencam: 78130 - Opening new event 31655, section start]
Oct 4 16:50:07 virgo zmc_dvideo0[1891]: INF [CarCam: 650000 - Capturing at 25.00 fps]
Oct 4 16:50:11 virgo zmeventnotification[7857]: INF [Total event client connections: 1]
Oct 4 16:50:11 virgo zmeventnotification[7857]: INF [Reloading Monitors...]
Oct 4 16:50:11 virgo zmeventnotification[7857]: INF [Loading monitors]

Oct 4 16:50:16 virgo zmfilter[1806]: INF [Creating notification email]
Oct 4 16:50:16 virgo zmfilter[1806]: INF [Sending notification email 'ZM Alert']
Oct 4 16:50:16 virgo zmfilter[1806]: INF [Attaching '/usr/share/zoneminder/www/events/6/16/10/04/16/40/00/01488-capture.jpg]
Oct 4 16:50:16 virgo zmfilter[1806]: INF [Attaching '/usr/share/zoneminder/www/events/6/16/10/04/16/40/00/09229-capture.jpg]
Oct 4 16:50:16 virgo zmfilter[1806]: INF [Notification email sent]
Oct 4 16:50:17 virgo zma_m6[1894]: INF [CarCam: 639000 - Analysing at 23.81 fps]

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.