.. _alarm_monitor: **************************************************** Alarm Monitor **************************************************** .. rubric:: In this chapter: .. contents:: :local: FindFace Multi allows for embedding an alarm monitor service, an additional functionality that displays information about individual alarms and events as they occur. This increases the awareness of the security service regarding critical events. An alarm monitor cannot be blocked by other windows, and the configuration cannot be changed to mute, which makes it a simpler tool for monitoring centers. Operators can acknowledge alarms or discard. .. Alarm events may also be sent by email and Telegram bot. .. _architecture-annex: Server Preparation ========================= For working alarm monitor service, FindFace Multi uses Annex, a software platform that provides video analytics tools. Annex is installed by default when you :ref:`deploy FindFace Multi `, and includes a set of components and services: +-----------------------------+--------------+-----------------------------------------------------------------------------------------------+--------------------------------------------+ | Component | Ports in use | Description | Vendor | +=============================+==============+===============================================================================================+============================================+ | backend_provider | 1111 | Service that provides an interface (REST API) for delivering data to various microservices, | NtechLab own deployment | | | | enriches input data if necessary and converts them to the desired format. | | +-----------------------------+--------------+-----------------------------------------------------------------------------------------------+ + | backend_api | 2222 | Service that provides an interface (REST API) to application service databases, | | | | | as well as a proxy interface to FindFace Multi and FindFace Server. | | +-----------------------------+--------------+-----------------------------------------------------------------------------------------------+ + | service_notifier | 3311 | The auxiliary service for sending notifications (Notify) through various client | | | | | channels (WebSocket, Telegram, Mail), as well as for sending client responses (Reply) | | | | | back to the services. | | +-----------------------------+--------------+-----------------------------------------------------------------------------------------------+ + | alarm-app | 4444 | A web service of the Alarm Monitor. | | +-----------------------------+--------------+-----------------------------------------------------------------------------------------------+ + | service_alarmer | n/a | An application service for announcing alarm messages with the ability to acknowledge | | | | | them by the user. | | +-----------------------------+--------------+-----------------------------------------------------------------------------------------------+--------------------------------------------+ Annex receives events from FindFace Multi via webhooks and sends them to Alarm Monitor. Before runnning Alarm Monitor, make sure Annex is deployed and perform some preliminary actions in FindFace Multi. #. Make sure all Annex :ref:`services ` are running. .. code:: sudo docker ps -a #. In order Alarm Monitor to work correctly with Annex, it is necessary to enable the VERBOSE_WEBHOOKS parameter to get information about the webhook, line crossing, matched cards as well as SAVE_DETECTOR_PARAMS to get information about the bbox. .. code:: sudo vi /opt/findface-multi/configs/findface-multi-legacy/findface-multi-legacy.py FFSECURITY = { ... # send serialized cards, card-lists, camera and camera groups in webhooks 'VERBOSE_WEBHOOKS': True, ... # save full detector params from video worker request 'SAVE_DETECTOR_PARAMS': True, ... } #. Restart all FindFace Multi containers. .. code:: cd /opt/findface-multi/ sudo docker-compose restart #. In the web interface FindFace Multi create a user. See :ref:`users`. Use these credentials to log in Alarm Monitor. Setting Events ======================= In order for the alarm monitor service to be able to receive events of matching objects, line crossing and counter events from FindFace Multi, use :ref:`webhooks `. To monitor events, do the following: #. In the FindFace Multi web interface, navigate to the :guilabel:`Settings` tab. Click :guilabel:`Webhooks`. #. Click :guilabel:`Add new webhook`. #. Specify the webhook header. #. Specify URL to automatically send notifications ``http://ip_address:port/ff_multi/alarmer/``. .. note:: ``ip_address:port`` must be substituted into your IP address for Annex and a port for ``backend_provider``, for example ``http://127.0.0.1:1111/ff_multi/alarmer/``. #. Specify filters. .. #. At the end of URL specify channels, for example ``?channels=110``, to send notifications to Telegram-bot, if necessary. Then fill in the BOT_TOKEN for the ``service_notifier_tg`` service in the ``docker-compose.yaml`` file to use the telegram bot functionality. .. code:: sudo vi /opt/findface-multi/docker-compose.yaml service_notifier_tg: ... environment: {..., BOT_TOKEN: '110', ....} ... The position of the ``1`` determines where the message will be sent. The first character defines WebSocket. The second symbol defines Telegram. The third character defines Mail. For example, the ``111`` will indicate sending notifications to all channels, and ``010``– only to Telegram-bot. .. _alarm_monitor_settings: Setting Application ================================ * The application is available for different platforms and operating systems. * The application is deployed in the standard way for your operating system and also available from the FindFace Multi navigation bar in the web-interface. .. note:: We recommend installing Alarm Monitoring Application. Please contact our support and sales team on support@ntechlab.com to get the latest version. Do the following: #. Download the latest version of Alarm Monitoring Application for your operating system. #. Run the executable file to launch the application. |alarm_monitor_main_en| .. |alarm_monitor_main_en| image:: /_static/alarm_monitor_main_en.png :scale: 40% .. |alarm_monitor_main_ru| image:: /_static/alarm_monitor_main_ru.png :scale: 40% #. Navigate to the settings. |alarm_monitor_settings_en| .. |alarm_monitor_settings_en| image:: /_static/alarm_monitor_settings_en.png :scale: 40% .. |alarm_monitor_settings_ru| image:: /_static/alarm_monitor_settings_ru.png :scale: 40% .. note:: If you use a web interface for running the Alarm Monitor, enter ``http://ip_address:4444/config/`` in the address bar to navigate to the settings. Where ``ip_address`` is the IP address available for Annex. #. Select the alarm sound and volume. #. If necessary, test the alarm sound by clicking the button :guilabel:`Imitation Alarm`. #. Specify the web service address, for example ``ws://ip_address/annex``. .. note:: ``ip_address`` is the IP address available for Annex. #. Select the interface language. #. Click :guilabel:`Save`. #. Click :guilabel:`Log in`. #. Enter username and password. .. _alarm_monitor_working: Work with the Alarm Monitor ====================================================== Alarm Monitor does not display any information by default. When receiving the alarm, the application displays information about the event together with an audio signal. The application will alternately display events until each of them is confirmed. The following types of alarm events are supported by Alarm Monitor: * Line crossing (the line and track are currently displayed only for bodies and faces) * Matches/non-matches with lists (for faces, bodies and vehicle) * Counters (bbox are currently displayed only for bodies) **Example of line crossing event** |alarm_monitor_line_crossing_en| .. |alarm_monitor_line_crossing_en| image:: /_static/alarm_monitor_line_crossing_en.png :scale: 40% .. |alarm_monitor_line_crossing_ru| image:: /_static/alarm_monitor_line_crossing_ru.png :scale: 40% The following elements are displayed: * Full frame of the event with the bbox of the body, the line crossing and the track of the object * Photo of the body crossing the line * Webhook header * Camera group/Camera * Date and time of the event **Example of object (face/body) matching event** |alarm_monitor_event_en| .. |alarm_monitor_event_en| image:: /_static/alarm_monitor_event_en.png :scale: 40% .. |alarm_monitor_event_ru| image:: /_static/alarm_monitor_event_ru.png :scale: 40% The following elements are displayed: * Full frame of the event * Photo of the object from the video stream * Photo of the matched object from the record index and a match probability * Watch lists that contain a person/vehicle * Webhook header * Camera group/Camera * Date and time of the event **Example of counter event** |alarm_monitor_counter_en| .. |alarm_monitor_counter_en| image:: /_static/alarm_monitor_counter_en.png :scale: 40% .. |alarm_monitor_counter_ru| image:: /_static/alarm_monitor_counter_ru.png :scale: 40% The following elements are displayed: * Full frame of the event * Screenshot * Counter name and number of bodies in the screenshot * Webhook header * Camera group/Camera * Date and time of the event Click :guilabel:`Accept` to acknowledge the alarm, or :guilabel:`No` to discard. Alarm confirmation is expected within 90 seconds by default. After the interval expires, an automatic confirmation occurs. You may change this value using the ``ack_interval`` parameter in the webhook URL, for example ``http://127.0.0.1:1111/ff_multi/alarmer/?ack_interval=180``. If the value is ``0``, no confirmation is expected.