Tutorial: Defining a threshold to run a command on the managed resource

You can use the Threshold Editor to pass certain parameters to agents. You can specify commands or a script of commands to run automatically when an event is triggered.

About this task

This tutorial shows you how to use the Execute Command field to pass a parameter to your IBM® Cloud Application Performance Management agent.

Procedure

  1. Open the Threshold Manager by selecting icon System Configuration > Threshold Manager.
  2. Select Linux OS from the Data Source Type field.
    The thresholds that were defined for the Linux OS agent are displayed in the table.
  3. Click icon New to open the Threshold Editor for defining the threshold.
  4. Define the threshold and conditions by specifying values for the various parameters, such as Name, Severity, and Conditions.
  5. Select KLZ Disk from the Data set field.
    KLZ Disk data set and Execute command fields.
  6. Enter the following command in the Execute Command field:
    /scripts/clean_logs.sh &{KLZ_Disk.Disk_Name}
    You must replace the space in the KLZ Disk data set name with an underscore.
    Note: The data set name referenced in the Execute Command field must be the same data set that is selected in step 5.
    The KLZ_Disk.Disk_Name is passed into the command script.

Results

Your script or command is set up to automatically run for your defined threshold. You must ensure the script or programs executed by the command are installed on the agent system since Cloud APM does not provide a mechanism to distribute scripts or programs.The command or script is run on the system of the monitoring agent that is monitoring the threshold condition. The user who starts the monitoring agent must have permission to execute the script or command.