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