Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width50%
Panel
borderColor#CCCCCC
bgColor#FFFFFF
titleBGColor#F0F0F0
borderStylesolid
titleOn the page:

Table of Contents

 

Column


General information

This action starts an external program on your the selected server of the Axxon-domain.

Note
titleAttention!

Any software containing a GUI is not recommended to be executed on the Server. If you encounter a problem launching interactive services, please We don't recommend running programs with GUI on the server. If you have problems with running interactive services, refer to the Windows OS user manual. 

Configuring an action

To configure this action, do the following:

  1. Allow interaction of the server NGP Host service with

  2. the
  3. desktop: Start Control Panel Administrative Tools Services

  4. Net Logon
  5. Netlogon Properties Log On.
    Image Modified

    Info
    titleNote

    For the Failover server and client installation type (

  6. see
  7. see Installation), you

  8. have to
  9. must allow the NGP RaFT supervisor service to interact with desktop.

  10. Add to folder
  11. <Directory where
  12. <Axxon One
  13. is installed>
  14. installation directory>\UserScripts\ one or more .bat files with the application startup command.

  15. The
  16.  The command
  17. should
  18. must include a path to the executable file of the program. You can specify a network path
  19. and
  20. , command
  21. -
  22. line
  23. options (see Starting an external program on Clients).Select the
  24. parameters (see Run external application on client) and use templates (see Text templates in the action settings).
  25. Go to the Programming tab.
  26. In the Event rules or Cycle rules list, click Create... (see Configuring macros).
  27. Select a start condition that triggers a macro (see Configuring start conditions).
  28. Click the Image Added button below start conditions.
  29. From the drop-down list, select General: Run external application on server.
  30. In the Launch external program on server parameter, select the server where you want to run the program
  31. (1)
  32. .
  33. Image RemovedSelect
  34. Image Added
  35. In the Executable files parameter, select a .bat file with the run command
  36. (2)
  37. .
  38. Enter
  39. In the Launch parameters parameter, enter templates, if they were set
  40. via
  41. in a .bat file
  42. (3).
  43. .
    Note
    titleAttention!

    If you expect a wildcard to contain spaces and/or some special shell characters (> & | <, and so on) as a result of the query, the template must be enclosed in quotation marks (""). For example, "{rectangles}". It is necessary to quote the entire template string.

  44. Click the Apply Image Added button.

Configuration of the Run external application on server action is complete.

Example use

Example 1

If you use a bat file with contentsExample 1: If you apply the following bat file:

Code Block
SET "datatime=%1"
SET "cameraIpAddress=%2"
 
msg * Current time is %datatime%, IP-address: %cameraIpAddress%

executing the macro will lead to results in the following message:

Image RemovedImage Added

Example 2

Export events about camera status changes (signal lost/restored) in csv format, a bat file with contents: Exporting camera connection status events (offline/online) to a csv.bat file containing the following:

Code Block
SELECT "timestamp"
    ,REGEXP_REPLACE("object_id", 'hosts/', '') as device,
    CASE
                                WHEN ("any_values"::json->>'state') = '4' THEN 'Signal Lost'
                                WHEN ("any_values"::json->>'state') = '3' THEN 'Signal Restored'
                                ELSE ''
        END as state
FROM public."t_json_event"
WHERE type = '0' AND ("any_values"::json->>'state'='3' OR "any_values"::json->>'state'='4') AND timestamp >= '20200211T0000'
ORDER by timestamp DESC

Example 3

Export of all input events in csv format, a bat file with contents:: Exporting detection tools triggering events to a csv.bat file containing the following: 

Code Block
SELECT "timestamp",
        REGEXP_REPLACE("object_id", 'hosts/', '') as device,
        CASE
                                WHEN ("any_values"::json->>'phase') = '1' THEN 'Closed'
                                WHEN ("any_values"::json->>'phase') = '2' THEN 'Opened'
                                ELSE ''
        END as state
FROM public."t_json_event"
WHERE type = '1' AND timestamp >= '20200209T110000' AND "object_id" LIKE '%ray%'
ORDER by timestamp DESC

...