Executing Program

You can configure Applications Manager to automatically trigger scripts/programs/server commands when an alarm is generated. This will help minimize manual intervention in resolving system/application issues.

This document covers:

Configuring Execute Program Action

To execute a program, follow these steps:

  1. Select the New Action link from the top menu.
  2. Click Execute Program from the Actions in the left frame and specify the following details:
    • Enter the Display Name for the action.
    • Choose whether the program to be executed is from the local server or from a remote server.
    • If the program is in a remote server, choose the Host Name from the list of existing servers or else you can add a new host.
    • For configuring a new host, enter the following details - Host Name / IP Address, Execution Mode (Telnet/SSH/Powershell), User Name and Password of the host, port number (Default Telnet port no: 23, SSH port no: 22) and then specify the command prompt value (for Telnet/SSH), which is the last character in your command prompt. Default value is $ and possible values are >, #, etc
    • Enter the Program to be executed. Use the Upload Files/Binaries option to upload the script file .
    • Enter the directory path from which the script should be executed.
    • You can use the Notify after action execution option to receive response for both success or failure conditions of an action either by selecting an existing email address or by defining a new email address using the New Action link.
    • The Abort after field is used to specify the timeout value for the program. Specify the time after which the program should be terminated.

      Note: It is important to provide the required time for aborting the command execution since the alarm processing is held up by the program execution. That is, while executing the program, the command runs synchronously in the mail alarm processing thread. This will delay all the alarms, following the alarms being processed, until the program execution is completed or terminated.

  3. Click Create Action to finish. This will list the Execute Program action name and its details along with the other actions configured.

View/Edit Execute Program Action

You can view and edit an existing Execute Program or execute that action from Admin tab > Actions page.

  • To edit the action, click the Edit [ ] icon.
  • You can also have a trial execution of the action. To do so, click the Execute icon [ ] of that action.

Execute Program Usage

Pointers to where you can use Execute Program action

  • Integrate a .vbs script to be executed by writing a simple .bat file. With this you can restart a remote service, reboot a machine etc.
  • Execute custom actions like calling a python script or Java class etc.
  • Invoke a .wav file to make some alarm noise on the server.
  • Execute a script on a remote server.
  • Trigger actions like cleaning up a hard disk when the usage exceeds some threshold limit.

Note: Passing arguments to custom scripts can be further enhanced by using Replaceable Tags.

Securing Execute Program Action

Execute Program Action option is designed to help users handle application problems and let them accomplish mundane tasks quickly, allowing them to reduce the impact of outages. It helps users rectify problems easily and efficiently. 

Execute Program Action has the integrated ability to run scripts (incl. Powershell scripts) and server commands based on the user privilege that runs Applications Manager. Caution must be exercised with their usage. Some additional security features built to assist users are:

  • Only users with Administrator privilege are allowed to create or use Execute Program action.
  • Create / Edit / Delete of Execute Program Action will be audited and details regarding the same will be available in Admin tab > Audit Logs page.
  • An option to blacklist certain commands is available (in AppManager_Home\conf\BlackListCommands.properties file). These commands cannot be used in Execute Program Action. Details regarding the same is available here.
  • An option is available to disable uploading of Scripts in Applications Manager under Admin tab > Server Settings > Enable file Upload.
  • Be sure to validate the accuracy of scripts before running them and confirm if they are from a trusted source to prevent unintended script execution.