# 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_url = https://my_custom_url/function_name # 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