I'm working on setting up zmeventnotification with hooks and am struggling with a download url error. The event server seems to be working ok, but I can't get a hook to work due to a download error. I am using SSL, but I do not have authentication set up for the zoneminder portal as it's locked away on my LAN.
I'm on kubuntu 20.04 with zoneminder 1.34.16. Here's my zneventnotification start:
Code: Select all
$ sudo -u www-data /usr/bin/zmeventnotification.pl
06/27/2020 12:09:16.026407 zmeventnotification[483655].INF [main:881] [PARENT: using config file: /etc/zm/zmeventnotification.ini]
06/27/2020 12:09:16.048231 zmeventnotification[483655].INF [main:881] [PARENT: using secrets file: /etc/zm/secrets.ini]
06/27/2020 12:09:16.230741 zmeventnotification[483655].INF [main:881] [PARENT: Push enabled via FCM]
06/27/2020 12:09:16.240616 zmeventnotification[483655].INF [main:881] [PARENT: MQTT Disabled]
06/27/2020 12:09:16.250109 zmeventnotification[483655].INF [main:881] [PARENT: |------- Starting ES version: 5.13 ---------|]
Can't ignore signal CHLD, forcing to default.
06/27/2020 12:09:16.445339 zmeventnotification[483655].INF [main:881] [PARENT: Event Notification daemon v 5.13 starting]
06/27/2020 12:09:16.457578 zmeventnotification[483655].INF [main:881] [PARENT: Re-loading monitors]
06/27/2020 12:09:16.489880 zmeventnotification[483655].INF [main:881] [PARENT: Secure WS(WSS) is enabled...]
06/27/2020 12:09:16.502050 zmeventnotification[483655].INF [main:881] [PARENT: Web Socket Event Server listening on port 9000]
Code: Select all
$ sudo -u www-data /var/lib/zmeventnotification/bin/zm_event_start.sh 2942 garage
^ returns without info
log:
==> /var/log/zm/zmesdetect_mgarage.log <==
06/27/20 12:45:11 zmesdetect_mgarage[485065] INF zm_detect.py:177 [---------| hook version: 5.13.3, ES version: 5.13 , OpenCV version: 4.4.0-pre|------------]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG1 utils.py:265 [secret filename: /etc/zm/secrets.ini]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:238 [Secret token found in config: !ZM_API_PORTAL]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:238 [Secret token found in config: !ML_USER]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:238 [Secret token found in config: !ML_PASSWORD]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:238 [Secret token found in config: !PLATEREC_ALPR_KEY]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG1 utils.py:288 [allowing self-signed certs to work...]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:342 [key [config] is '/var/lib/zmeventnotification/models/yolov3/yolov3.cfg' after substitution]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:342 [key [weights] is '/var/lib/zmeventnotification/models/yolov3/yolov3.weights' after substitution]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:342 [key [labels] is '/var/lib/zmeventnotification/models/yolov3/yolov3_classes.txt' after substitution]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:342 [key [tiny_config] is '/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.cfg' after substitution]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:342 [key [tiny_weights] is '/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.weights' after substitution]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:342 [key [tiny_labels] is '/var/lib/zmeventnotification/models/tinyyolo/yolov3-tiny.txt' after substitution]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:342 [key [known_images_path] is '/var/lib/zmeventnotification/known_faces' after substitution]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG2 utils.py:342 [key [unknown_images_path] is '/var/lib/zmeventnotification/unknown_faces' after substitution]
06/27/20 12:45:11 zmesdetect_mgarage[485065] INF zm_detect.py:206 [Importing local classes for Yolo/Face]
06/27/20 12:45:11 zmesdetect_mgarage[485065] DBG1 utils.py:143 [Trying to download /index.php?view=image&eid=2942&fid=alarm]
06/27/20 12:45:11 zmesdetect_mgarage[485065] ERR zm_detect.py:220 [Error downloading files: unknown url type: '/index.php?view=image&eid=2942&fid=alarm']
06/27/20 12:45:11 zmesdetect_mgarage[485065] FAT zm_detect.py:221 [animation: Traceback:Traceback (most recent call last):
File "/var/lib/zmeventnotification/bin/zm_detect.py", line 217, in <module>
filename1, filename2, filename1_bbox, filename2_bbox = utils.download_files(
File "/usr/local/lib/python3.8/dist-packages/zmes_hook_helpers/utils.py", line 145, in download_files
input_file = opener.open(url)
File "/usr/lib/python3.8/urllib/request.py", line 509, in open
req = Request(fullurl, data)
File "/usr/lib/python3.8/urllib/request.py", line 328, in __init__
self.full_url = url
File "/usr/lib/python3.8/urllib/request.py", line 354, in full_url
self._parse()
File "/usr/lib/python3.8/urllib/request.py", line 383, in _parse
raise ValueError("unknown url type: %r" % self.full_url)
ValueError: unknown url type: '/index.php?view=image&eid=2942&fid=alarm'
Code: Select all
ZMES_PICTURE_URL=https://margaritaville.lucky.org/zm/?view=image&eid=EVENTID&fid=snapshot&width=600
Code: Select all
$ sudo /usr/bin/zmeventnotification.pl --check-config
06/27/2020 12:53:00.541012 zmeventnotification[485225].INF [main:881] [PARENT: using config file: /etc/zm/zmeventnotification.ini]
06/27/2020 12:53:00.562456 zmeventnotification[485225].INF [main:881] [PARENT: using secrets file: /etc/zm/secrets.ini]
Configuration (read /etc/zm/zmeventnotification.ini):
Secrets file.......................... /etc/zm/secrets.ini
Base data path........................ /var/lib/zmeventnotification
Restart interval (secs)............... (undefined)
Use admin interface .................. no
Admin interface password.............. (undefined)
Admin interface persistence file ..... /var/lib/zmeventnotification/misc/escontrol_interface.dat
Port ................................. 9000
Address .............................. [::]
Event check interval ................. 5
Monitor reload interval .............. 300
Skipped monitors...................... (undefined)
Auth enabled ......................... yes
Auth timeout ......................... 20
Use API Push.......................... no
API Push Script....................... (undefined)
Use FCM .............................. yes
FCM Date Format....................... %I:%M %p, %d-%b
FCM API key .......................... (defined)
Token file ........................... /var/lib/zmeventnotification/push/tokens.txt
Use MQTT ............................. no
MQTT Server .......................... 127.0.0.1
MQTT Username ........................ (undefined)
MQTT Password ........................ (undefined)
MQTT Retain .......................... no
MQTT Tick Interval ................... 15
SSL enabled .......................... yes
SSL cert file ........................ /etc/ssl/certs/apache-selfsigned.crt
SSL key file ......................... /etc/ssl/private/apache-selfsigned.key
Verbose .............................. no
ES Debug level.........................2
Read alarm cause ..................... yes
Tag alarm event id ................... yes
Use custom notification sound ........ no
Send event end notification............yes
Use Hooks............................. yes
Hook Script on Event Start ........... '/var/lib/zmeventnotification/bin/zm_event_start.sh'
Hook Script on Event End.............. '/var/lib/zmeventnotification/bin/zm_event_end.sh'
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://margaritaville.lucky.org/zm/?view=image&eid=EVENTID&fid=snapshot&width=600
Include picture....................... yes
Picture username ..................... zmuser
Picture password ..................... (defined)
I'd appreciate any advise, and thanks!