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:
- Select the New Action link from the top menu.
- 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, specify the Target Hosts on which these actions are to be executed. There are three options available here:
- Auto-select Hosts: This option will automatically detect and trigger Execute Program action based on the associated monitor. For example, if the action is associated with a host, the action will be triggered for that particular host. If the action is associated with a Tomcat monitor, this action will be triggered for the host of the Tomcat server.
- Selected Hosts: This option lets you specify the exact hosts on which the action will be triggered. You can select the hosts from the ones listed.
- All Hosts in the selected Monitor Group: This option lets the action to be triggered on the server monitor's hosts present in the Monitor Groups. You can select the Monitor Group from the ones listed.
Additionally, you can also choose to 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.
- If you want to execute the action during specific time periods, enable the Execute Action based on Business Hours option and select the Business Hour during which the action has to be executed. The action can be configured such that it is executed during or outside the selected Business Hours. Use the drop-down menu to select your time window or click on 'Add New Business Hour' to create a new time window.
- 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.