[Solved] zmes not getting any events from Zoneminder v1.37.16

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
Droid
Posts: 1
Joined: Thu May 26, 2022 9:25 pm

[Solved] zmes not getting any events from Zoneminder v1.37.16

Post by Droid »

Okay - worked out why zmes was not getting any events. The SQL query was only looking for a monitor to be in one of these states "Modect,Mocord,Nodect"

My monitors are in a state of "Monitor"

Changing /usr/bin/zmeventnotification.pl to the below and it all works ( add Monitor to the SQL statement ).

Code: Select all

# Refreshes list of monitors from DB
#
sub loadMonitors {


  printInfo("Re-loading monitors");
  $monitor_reload_time = time();

  my $sql = 'SELECT * FROM `Monitors`
        WHERE find_in_set( `Function`, \'Monitor,Modect,Mocord,Nodect\' )'
    . ( $Config{ZM_SERVER_ID} ? 'AND `ServerId`=?' : '' );
-------------------------------------------------- Original message below --------------------------------------------------

Hi

I have setup zmeventnotification and opencv.

Both seem to be setup correctly, however, zmeventnotification never gets any of the events generated by Zoneminder.

When running in debug mode, it just continually gets 0 events, even after triggering a manual alarm from a monitor.

Zoneminder version is v1.37.16
zmeventnotification version is 6.1.28
Running on Ubuntu 22.04

Any ideas on where to look?

I can manually run the zm_detect script, and that is all working - just need zmeventnotification to see an event.

Thanks

Code: Select all

db@cctv:/var/log/zm$ sudo -u www-data /usr/bin/zmeventnotification.pl --debug
05/27/2022 07:22:33.709855 zmeventnotification[43319].INF [main:338] [Running on WebSocket library version:0.004]
INF:2022-05-27,07:22:34 PARENT: using config file: /etc/zm/zmeventnotification.ini
05/27/2022 07:22:34.046855 zmeventnotification[43319].INF [main:1048] [PARENT: using config file: /etc/zm/zmeventnotification.ini]
INF:2022-05-27,07:22:34 PARENT: using secrets file: /etc/zm/secrets.ini
05/27/2022 07:22:34.456846 zmeventnotification[43319].INF [main:1048] [PARENT: using secrets file: /etc/zm/secrets.ini]
DBG-2:2022-05-27,07:22:34 PARENT: Got secret token !ZMES_PICTURE_URL
DBG-2:2022-05-27,07:22:34 PARENT: Got secret token !ZM_USER
DBG-2:2022-05-27,07:22:34 PARENT: Got secret token !ZM_PASSWORD
DBG-2:2022-05-27,07:22:34 PARENT: config string substitution: {{base_data_path}} is '/var/lib/zmeventnotification'
DBG-2:2022-05-27,07:22:34 PARENT: config string substitution: {{base_data_path}} is '/var/lib/zmeventnotification'

Configuration (read /etc/zm/zmeventnotification.ini):

Secrets file.......................... /etc/zm/secrets.ini
Base data path........................ /var/lib/zmeventnotification
Restart interval (secs)............... 0

Use admin interface .................. no
Admin interface password.............. (undefined)
Admin interface persistence file ..... /var/lib/zmeventnotification/misc/escontrol_interface.dat

Port ................................. 9000
Address .............................. cctv.network.home
Event check interval ................. 2
Monitor reload interval .............. 300
Skipped monitors...................... (undefined)

Auth enabled ......................... yes
Auth timeout ......................... 20

Use API Push.......................... no
API Push Script....................... (undefined)

Use FCM .............................. no
Use FCM V1 APIs....................... yes
FCM Date Format....................... %I:%M %p, %d-%b
Only show latest FCMv1 message........ no
Android FCM push priority............. high
Android FCM push ttl.................. (undefined)
Log FCM message ID.................... NONE
Log RAW FCM Messages...................no
FCM V1 URL............................ https://us-central1-ninja-1105.cloudfunctions.net/send_push
FCM V1 Key.............................default
 
Token file ........................... /var/lib/zmeventnotification/push/tokens.txt

Use MQTT ............................. no
MQTT Server .......................... 127.0.0.1
MQTT Topic ........................... zoneminder
MQTT Username ........................ (undefined)
MQTT Password ........................ (undefined)
MQTT Retain .......................... no
MQTT Tick Interval ................... 15
MQTT TLS CA ........................ (undefined)
MQTT TLS Cert ........................ (undefined)
MQTT TLS Key ........................ (undefined)
MQTT TLS Insecure ........................ no

SSL enabled .......................... yes
SSL cert file ........................ /etc/zm/apache2/ssl/zoneminder.crt
SSL key file ......................... /etc/zm/apache2/ssl/zoneminder.key

Verbose .............................. yes
ES Debug level.........................5
Read alarm cause ..................... yes
Tag alarm event id ................... yes
Use custom notification sound ........ no
Send event start notification..........yes
Send event end notification............yes
Monitor rules JSON file................(undefined)

Use Hooks............................. yes
Max Parallel Hooks.................... 0
Hook Script on Event Start ........... '/var/lib/zmeventnotification/bin/zm_event_start.sh'
User Script on Event Start.............(undefined)
Hook Script on Event End.............. '/var/lib/zmeventnotification/bin/zm_event_end.sh'
User Script on Event End...............(undefined)
Hook Skipped monitors................. (undefined)

Notify on Event Start (hook success).. all
Notify on Event Start (hook fail)..... none
Notify on Event End (hook success).... fcm,web,api
Notify on Event End (hook fail)....... none
Notify End only if Start success...... yes

Use Hook Description.................. yes
Keep frame match type................. yes
Store Frame in ZM......................yes

Picture URL .......................... https://cctv.network.home/zm/index.php?view=image&eid=EVENTID&fid=objdetect&width=640
Include picture....................... yes
Picture username ..................... zmes
Picture password ..................... (defined)

INF:2022-05-27,07:22:34 PARENT: FCM disabled.
05/27/2022 07:22:34.676388 zmeventnotification[43319].INF [main:1048] [PARENT: FCM disabled.]
INF:2022-05-27,07:22:34 PARENT: MQTT Disabled
05/27/2022 07:22:34.789372 zmeventnotification[43319].INF [main:1048] [PARENT: MQTT Disabled]
INF:2022-05-27,07:22:34 PARENT: |------- Starting ES version: 6.1.28 ---------|
05/27/2022 07:22:34.861543 zmeventnotification[43319].INF [main:1048] [PARENT: |------- Starting ES version: 6.1.28 ---------|]
DBG-2:2022-05-27,07:22:34 PARENT: Started with: perl:/usr/bin/perl and command:/usr/bin/zmeventnotification.pl
Can't ignore signal CHLD, forcing to default.
DBG-1:2022-05-27,07:22:35 PARENT: ES invoked manually. Will handle restarts ourselves
DBG-2:2022-05-27,07:22:35 PARENT: Parent<--Child pipe ready
INF:2022-05-27,07:22:35 PARENT: Event Notification daemon v 6.1.28 starting

05/27/2022 07:22:35.033680 zmeventnotification[43319].INF [main:1048] [PARENT: Event Notification daemon v 6.1.28 starting]
DBG-1:2022-05-27,07:22:35 PARENT: Total event client connections: 0

INF:2022-05-27,07:22:35 PARENT: Re-loading monitors
05/27/2022 07:22:35.138529 zmeventnotification[43319].INF [main:1048] [PARENT: Re-loading monitors]
DBG-2:2022-05-27,07:22:35 PARENT: ESCONTROL_INTERFACE is disabled. Not saving control data
DBG-2:2022-05-27,07:22:35 PARENT: checkEvents() new events found=0
DBG-2:2022-05-27,07:22:35 PARENT: About to start listening to socket
INF:2022-05-27,07:22:35 PARENT: Secure WS(WSS) is enabled...
05/27/2022 07:22:35.300861 zmeventnotification[43319].INF [main:1048] [PARENT: Secure WS(WSS) is enabled...]
INF:2022-05-27,07:22:35 PARENT: Web Socket Event Server listening on port 9000
05/27/2022 07:22:35.367143 zmeventnotification[43319].INF [main:1048] [PARENT: Web Socket Event Server listening on port 9000]
DBG-2:2022-05-27,07:22:37 PARENT: ----------> Tick START (active forks:0, total forks:0, active hooks: 0 running for:1 min)<--------------
DBG-2:2022-05-27,07:22:37 PARENT: After tick: TOTAL: 0,  ES_CONTROL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
DBG-2:2022-05-27,07:22:37 PARENT: There are 0 active child forks & 0 zm_detect processes running...
DBG-2:2022-05-27,07:22:37 PARENT: checkEvents() new events found=0
DBG-2:2022-05-27,07:22:37 PARENT: There are 0 new Events to process
DBG-2:2022-05-27,07:22:37 PARENT: ---------->Tick END (active forks:0, total forks:0, active hooks: 0)<--------------
DBG-2:2022-05-27,07:22:39 PARENT: ----------> Tick START (active forks:0, total forks:0, active hooks: 0 running for:1 min)<--------------
DBG-2:2022-05-27,07:22:39 PARENT: After tick: TOTAL: 0,  ES_CONTROL: 0, FCM+WEB: 0, FCM: 0, WEB: 0, MQTT:0, invalid WEB: 0, PENDING: 0
DBG-2:2022-05-27,07:22:39 PARENT: There are 0 active child forks & 0 zm_detect processes running...
DBG-2:2022-05-27,07:22:39 PARENT: checkEvents() new events found=0
DBG-2:2022-05-27,07:22:39 PARENT: There are 0 new Events to process
DBG-2:2022-05-27,07:22:39 PARENT: ---------->Tick END (active forks:0, total forks:0, active hooks: 0)<--------------
enviousjl
Posts: 3
Joined: Sat Dec 24, 2022 9:03 pm

Re: [Solved] zmes not getting any events from Zoneminder v1.37.16

Post by enviousjl »

Good call!! I've been scratching my head over this for like 3 days until I found your post LOL
Post Reply