Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

close
keyboard_arrow_left
Paragon Automation User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
keyboard_arrow_right

Modify User-Defined Action, Function, and Workflow Engines

date_range 25-Sep-23

The following section describes how you can modify the UDA/UDF/workflow engine in Paragon Automation command line interface (CLI).

You can modify the UDA, UDF, or workflow engine using the Paragon Automation CLI, as shown below.

Note:

You must run the following bash commands from the primary node of Paragon Automation.

content_copy zoom_out_map
user@paragon-master:/var/local/healthbot# ./healthbot modify-uda-engine --help
usage: healthbot modify-uda-engine [-h] (-s SCRIPT | --rollback) [--simulate]

optional arguments:
  -h, --help            show this help message and exit
  -s SCRIPT, --script SCRIPT
                        Run script in UDA engine
  --rollback, -r        Rollback UDA engine to original state
  --simulate            Run script in simulated UDA engine and show output


user@paragon-master:/var/local/healthbot# ./healthbot modify-udf-engine --help
usage: healthbot modify-udf-engine [-h] (-s SCRIPT | --rollback) [--simulate]
                                   [--service SERVICE]
optional arguments:
  -h, --help            show this help message and exit
  -s SCRIPT, --script SCRIPT
                        Run script in UDF engine
  --rollback, -r        Rollback UDF engine to original state
  --simulate            Run script in simulated UDF engine and show output
  --service SERVICE     Modify specific service UDF

root@paragon-master:/var/local/healthbot# ./healthbot modify-workflow-engine --help

usage: healthbot.py modify-workflow-engine [-h] (-s SCRIPT | --rollback)
                                           [--simulate]

optional arguments:
  -h, --help            show this help message and exit
  -s SCRIPT, --script SCRIPT
                        Run script in WORKFLOW engine
  --rollback, -r        Rollback WORKFLOW engine to original state
  --simulate            Run script in simulated WORKFLOW engine and show output

The commands have three main options:

  • Simulate—test a script (and view its output) in the simulated UDA/UDF/workflow engine environment without affecting the running Paragon Automation system

  • Modify—modify the actual UDA/UDF/workflow engine using a script

  • Rollback—revert to the original version of the UDA/UDF/workflow engine

Usage Notes

  • The bash script will run in a container running Ubuntu OS Release 16.04 or 18.04; write the script accordingly.

  • The script must be non-interactive; any questions must be pre-answered. For example, use the ‘-y’ option when installing a package using apt-get.

  • If you prefer to copy the source packages of the dependency modules onto the Paragon Insights server so the engine can manually install them instead of downloading them from the Internet, place the required source packages in the /var/local/healthbot/input directory. Then within your bash script, point to the /input directory. For example, to use a file placed in /var/local/healthbot/input/myfile.txt, set the bash script to access it at /input/myfile.txt.

  • Modifying the UDA/UDF/workflow engine more than once is not an incremental procedure; use a new bash script that includes both the original and new instructions, and re-run the modify procedure using the new script.

  • Modifications to UDA/UDF/workflow engines are applicable in current installation.

    Once you upgrade the version, you must run the script to modify UDA/UDF/workflow engines.

Note:

The following examples use the UDA engine; these procedures apply equally to the UDF and workflow engines.

Note:

The following procedure assumes that you installed Paragon Automation server.

Simulate

Use the simulate feature to test your bash script in the simulated environment, without affecting the running Paragon Insights system.

To simulate modifying the UDA engine:

  1. Enter the command ./healthbot modify-uda-engine -s /<path>/<script-file> --simulate.

  2. The script runs and the output shows on screen, just as if you entered the script commands yourself.

    content_copy zoom_out_map
    user@paragon-master:/var/local/healthbot# ./healthbot modify-uda-engine -s /var/tmp/test-script.sh --simulate
    Running /var/tmp/test-script.sh in simulated alerta engine..
    Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
    ...
    Fetched 4296 kB in 15s (278 kB/s)
    Reading package lists...
    
    Building dependency tree...
    
    Reading state information…
    ...
    

Modify

When you are satisfied with the simulation results, go ahead with the actual modification procedure.

To modify the UDA engine:

  1. Load the desired bash script onto the Paragon Insights server.

  2. If your Paragon Insights server is fully up and running, issue the command ./healthbot stop -s alerta to stop the running services.

  3. Run the command ./healthbot modify-uda-engine -s /<path>/<script-file>.

    content_copy zoom_out_map
    user@paragon-master:/var/local/healthbot# ./healthbot modify-uda-engine -s /var/tmp/test-script.sh
    Running /var/tmp/test-script.sh in simulated alerta engine..
    Success! See /tmp/.alerta_modification.log for logs
    Please restart alerta by issuing './healthbot start --device-group healthbot -s alerta'
    
  4. (Optional) As noted in the output, you can check the log file to further verify the script was loaded successfully.

  5. Restart the alerta service using the command ./healthbot start -s alerta.

  6. Once complete, verify that the alerta service is up and running using the command ./healthbot status.

  7. To verify that the UDA engine has been updated, use the command ./healthbot version -s alerta and check that the healthot_alerta container is using the <version>-custom tag.

    content_copy zoom_out_map
    user@paragon-master:/var/local/healthbot# ./healthbot version -s alerta
    {'alerta': 'healthbot_alerta:2.1.0-custom'}
    

The UDA engine is now running with the installed dependencies as per the bash script.

Rollback

If you have a need or desire to remove the changes to the engine, you can revert the engine to its original state.

To rollback the UDA engine:

  1. Enter the command ./healthbot modify-uda-engine --rollback.

    content_copy zoom_out_map
    user@paragon-master:/var/local/healthbot# ./healthbot modify-uda-engine --rollback
    Rolling back alerta engine to original state..
    Successfully rolled back alerta engine
    Please restart alerta by issuing './healthbot start --device-group healthbot -s alerta'
    

    Note that it is not necessary to restart the alerta service at this point.

  2. Once complete, verify that the alerta service is up and running using the command ./healthbot status.

  3. To verify that the UDA engine has reverted back, use the command ./healthbot version -s alerta and check that the healthot_alerta container is using the <version> tag.

    content_copy zoom_out_map
    user@paragon-master:/var/local/healthbot# ./healthbot version -s alerta
    {'alerta': 'healthbot_alerta:2.1.0'}
    

The UDA engine is now running in its original state, with no additional installed dependencies.

external-footer-nav