· 3 years ago · Mar 05, 2022, 09:30 AM
1root@30656f8d7a9e:/etc/zm# cat zmeventnotification.ini
2# Configuration file for zmeventnotification.pl
3[general]
4
5secrets = /etc/zm/secrets.ini
6base_data_path=/var/lib/zmeventnotification
7
8# The ES now supports a means for a special kind of
9# websocket connection which can dynamically control ES
10# behaviour
11# Default is no
12use_escontrol_interface=no
13
14# this is where all escontrol admin overrides
15# will be stored.
16escontrol_interface_file=/var/lib/zmeventnotification/misc/escontrol_interface.dat
17
18# the password for accepting control interfaces
19escontrol_interface_password=!ESCONTROL_INTERFACE_PASSWORD
20
21# If you see the ES getting 'stuck' after several hours
22# see https://rt.cpan.org/Public/Bug/Display.html?id=131058
23# You can use restart_interval to have it automatically restart
24# every X seconds. (Default is 7200 = 2 hours) Set to 0 to disable this.
25# restart_interval = 432000
26restart_interval = 0
27
28# list of monitors which ES will ignore
29# Note that there is an attribute later that does
30# not process hooks for specific monitors. This one is different
31# It can be used to completely skip ES processing for the
32# monitors defined
33# skip_monitors = 2,3,4
34
35[network]
36# Port for Websockets connection (default: 9000).
37port = 9000
38
39[auth]
40# Check username/password against ZoneMinder database (default: yes).
41enable = yes
42
43# Authentication timeout, in seconds (default: 20).
44timeout = 20
45
46[push]
47# This is to enable sending push notifications via any 3rd party service.
48# Typically, if you enable this, you might want to turn off fcm
49# Note that zmNinja will only receive notifications via FCM, but other 3rd
50# party services have their own apps to get notifications
51use_api_push = no
52
53# This is the script that will send the notification
54# Some sample scripts are provided, write your own
55# Each script gets:
56# arg1 - event ID
57# arg2 - Monitor ID
58# arg3 - Monitor Name
59# arg4 - alarm cause
60# arg5 - Type of event (event_start or event_end)
61# arg6 (optional) - image path
62
63api_push_script=/var/lib/zmeventnotification/bin/pushapi_pushover.py
64
65[fcm]
66# Use FCM for messaging (default: yes).
67enable = yes
68
69# Use the new FCM V1 protocol (recommended)
70use_fcmv1 = yes
71
72# if yes, will replace notifications with the latest one
73# default: no
74replace_push_messages = no
75
76# Custom FCM API key. Uncomment if you are using
77# your own API key (most people will not need to uncomment)
78# api_key =
79
80# Auth token store location (default: /var/lib/zmeventnotification/push/tokens.txt).
81token_file = {{base_data_path}}/push/tokens.txt
82
83# Date format to use when sending notification
84# over push (FCM)
85# See https://metacpan.org/pod/POSIX::strftime::GNU
86# For example, a 24 hr format would be
87#date_format = %H:%M, %d-%b
88
89date_format = %I:%M %p, %d-%b
90
91# Set priority for android push. Default is high.
92# You can set it to high or normal.
93# There is weird foo going on here. If you set it to high,
94# and don't interact with push, users report after a while they
95# get delayed by Google. I haven't quite figured out what is the precise
96# value to put here to make sure it always reaches you. Also make sure
97# you read the zmES faq on delayed push
98fcm_android_priority = high
99
100# If you see messages not being delivered in doze mode for android
101# Even AFTER you disable battery optimization for the app, try making this 0
102# otherwise leave it unspecified. The value here is in seconds
103# it specifies how long the message will be valid before it is discarded
104# Some reports say if you set this to 0, android will try and deliver it immediately
105# while others say it won't. YMMV.
106# fcm_android_ttl = 0
107
108# Use MQTT for messaging (default: no)
109[mqtt]
110enable = no
111# Allow you to set a custom MQTT topic name
112# default: zoneminder
113#topic = my topic name
114
115# MQTT server (default: 127.0.0.1)
116server = 127.0.0.1
117
118# Authenticate to MQTT server as user
119# username = !MQTT_USERNAME
120
121# Password
122# password = !MQTT_PASSWORD
123
124# Set retain flag on MQTT messages (default: no)
125retain = no
126
127# MQTT over TLS
128# Location to MQTT broker CA certificate. Uncomment this line will enable MQTT over TLS.
129# tls_ca = /config/certs/ca.pem
130
131# To enable 2-ways TLS, add client certificate and private key
132# Location to client certificate and private key
133# tls_cert = /config/es-pub.pem
134# tls_key = /config/es-key.pem
135
136# To allow insecure TLS (disable peer verifier), (default: no)
137# tls_insecure = yes
138
139
140
141[ssl]
142# Enable SSL (default: yes)
143enable = yes
144
145cert = !ES_CERT_FILE
146key = !ES_KEY_FILE
147
148#cert = /etc/apache2/ssl/zoneminder.crt
149#key = /etc/apache2/ssl/zoneminder.key
150
151# Location to SSL cert (no default).
152# cert = /etc/apache2/ssl/yourportal/zoneminder.crt
153
154# Location to SSL key (no default).
155# key = /etc/apache2/ssl/yourportal/zoneminder.key
156
157[customize]
158# Link to json file that has rules which can be customized
159# es_rules=/etc/zm/es_rules.json
160
161# Display messages to console (default: no).
162# Note that you can keep this to no and just
163# use --debug when running from CLI too
164console_logs = no
165# debug level for ES messages. Default 4. Note that this is
166# not controllable by ZM LOG_DEBUG_LEVEL as in Perl, ZM doesn't
167# support debug levels
168es_debug_level = 4
169
170# Interval, in seconds, after which we will check for new events (default: 5).
171event_check_interval = 5
172
173# Interval, in seconds, to reload known monitors (default: 300).
174monitor_reload_interval = 300
175
176# Read monitor alarm cause (Requires ZoneMinder >= 1.31.2, default: no)
177# Enabling this to 1 for lower versions of ZM will result in a crash
178read_alarm_cause = yes
179
180# Tag event IDs with the alarm (default: no).
181tag_alarm_event_id = yes
182
183# Use custom notification sound (default: no).
184use_custom_notification_sound = no
185
186# include picture in alarm (default: no).
187include_picture = yes
188
189
190# send event start notifications (default: yes)
191# If no, starting notifications will not be sent out
192send_event_start_notification = yes
193
194# send event end notifications (default: no)
195# Note that if you are using hooks for end notifications, they may change
196# the final decision. This needs to be yes if you want end notifications with
197# or without hooks
198send_event_end_notification = yes
199
200# URL to access the event image
201# This URL can be anything you want
202# What I've put here is a way to extract an image with the highest score given an eventID (even one that is recording)
203# This requires the latest version of index.php which was merged on Oct 9, 2018 and may only work in ZM 1.32+
204# https://github.com/ZoneMinder/zoneminder/blob/master/web/index.php
205# If you use this URL as I've specified below, keep the EVENTID phrase intact.
206# The notification server will replace it with the correct eid of the alarm
207
208# BESTMATCH should be used only if you are using bestmatch for FID in detect_wrapper.sh
209# objdetect is ONLY available in ZM 1.33+
210# objdetect_mp4 and objdetect_gif is ONLY available
211# in ZM 1.35+
212picture_url = !ZMES_PICTURE_URL
213picture_portal_username=!ZM_USER
214picture_portal_password=!ZM_PASSWORD
215
216# This is a master on/off setting for hooks. If it is set to no
217# hooks will not be used no matter what is set in the [hook] section
218# This makes it easy for folks not using hooks to just turn this off
219# default:no
220
221use_hooks = yes
222
223[hook]
224
225# NOTE: This entire section is only valid if use_hooks is yes above
226
227# When a hook is invoked, the ES forks a child. If you are in a situation
228# where your motion sensititivy in ZM is not set properly, you may land up
229# triggering hundreds of child processes of zm_detect that may potentially
230# crash your system. Note that there are global locks around the ML code which
231# are controlled by xxx_max_processes in the objectconfig/mlapiconfig.files
232# which will avoid parallel running of models. But this is if you are facing issues
233# by the simple fact that too many zm_detect processes are forked (which will apply
234# whether you use mlapi or not). While I do feel the core issue is that you need
235# to fix your ZM sensitivity, this parameter helps control.
236
237# NOTE: When you put in value for this, any hooks that attempt to kick off
238# beyond this limit will simply be ignored. There is no queueing.
239
240# A value of 0 (default) means there are no limits
241max_parallel_hooks=0
242
243
244# Shell script name here to be called every time an alarm is detected
245# the script will get passed $1=alarmEventID, $2=alarmMonitorId
246# $3 monitor Name, $4 alarm cause
247# script needs to return 0 to send alarm (default: none)
248#
249
250# This script is called when an event first starts. If the script returns "0"
251# (success), then a notification is sent to channels specified in
252# event_start_notify_on_hook_success. If the script returns "1" (fail)
253# then a notification is sent to channels specified in
254# event_start_notify_on_hook_fail
255event_start_hook = '{{base_data_path}}/bin/zm_event_start.sh'
256
257#This script is called after event_start_hook completes. You can do
258# your housekeeping work here
259#event_start_hook_notify_userscript = '{{base_data_path}}/contrib/example.py'
260
261
262# This script is called when an event ends. If the script returns "0"
263# (success), then a notification is sent to channels specified in
264# event_end_notify_on_hook_success. If the script returns "1" (fail)
265# then a notification is sent to channels specified in
266# event_end_notify_on_hook_fail
267# event_end_hook = '{{base_data_path}}/bin/zm_event_end.sh'
268
269#This script is called after event_end_hook completes. You can do
270# your housekeeping work here
271#event_end_hook_notify_userscript = '{{base_data_path}}/contrib/example.py'
272
273
274# Possible channels = web,fcm,mqtt,api
275# all is short for web,fcm,mqtt,api
276# use none for no notifications, or comment out the attribute
277
278# When an event starts and hook returns 0, send notification to all. Default: none
279event_start_notify_on_hook_success = all
280
281# When an event starts and hook returns 1, send notification only to desktop. Default: none
282event_start_notify_on_hook_fail = none
283
284# When an event ends and hook returns 0, send notification to fcm,web,api. Default: none
285event_end_notify_on_hook_success = fcm,web,api
286
287# When an event ends and hook returns 1, don't send notifications. Default: none
288event_end_notify_on_hook_fail = none
289#event_end_notify_on_hook_fail = web
290
291# Since event_end and event_start are two different hooks, it is entirely possible
292# that you can get an end notification but not a start notification. This can happen
293# if your start script returns 1 but the end script returns 0, for example. To avoid
294# this, set this to yes (default:yes)
295event_end_notify_if_start_success = yes
296
297# If yes, the text returned by the script
298# overwrites the alarm header
299# useful if your script is detecting people, for example
300# and you want that to be shown in your notification (default:yes)
301use_hook_description = yes
302
303# If yes will will append an [a] for alarmed frame match
304# [s] for snapshot match or [x] if not using bestmatch
305# really only a debugging feature but useful to know
306# where object detection is working or failing
307keep_frame_match_type = yes
308
309# list of monitors for which hooks will not run
310# hook_skip_monitors = 2
311
312
313# if enabled, will pass the right folder for the hook script
314# to store the detected image, so it shows up in ZM console view too
315# Requires ZM >=1.33. Don't enable this if you are running an older version
316
317# Note: you also need to set write_image_to_zm=yes in objectconfig.ini
318# default: no
319hook_pass_image_path = yes