When configuring a Command Line Monitor in Monitoring Studio, you can indicate if the command is successful or failed when a specific exit code is found. Before configuring the Command Line Monitor, it is therefore important to:
- Decide which command you would like to run
- List the possible exit codes for this command
- Select the exit codes that should be associated to a successful/failed command execution.
In our example, we will run a curl command for which we know that these exit codes may occur:
- CURLE_OK (0)
- CURLE_UNSUPPORTED_PROTOCOL (1)
- CURLE_FAILED_INIT (2)
- CURLE_URL_MALFORMAT (3)
- CURLE_NOT_BUILT_IN (4)
- CURLE_COULDNT_RESOLVE_PROXY (5)
- CURLE_COULDNT_RESOLVE_HOST (6)
- CURLE_COULDNT_CONNECT (7)
Imagine that we want to perform a health check of a specific URL and alert when it cannot be reached (the curl command then returns the exit code 7).
Before configuring the Command Line Monitor, we first:
For more information, refer to the Hosts and Templates documentation.
- Define the Host to be monitored
- Create our Template
- Apply our Template to our specific Host.
Then, we edit our Template to add a Command Line Monitor:
- In the Command Line field, we enter the command to be run. In our example:
We then indicate the credentials to be used to run the command and whether it will be run on the Monitored Host or on the Agent system. In our example, it is on the Monitored Host.
In the Execution Validation section, we indicate the conditions to validate the command. In our example, the Failed Exit Code is 7.
- Finally, we click Create.
- Monitoring Studio Denies Access to the Web Interface
- Getting Notified When a Parameter is no Longer in Alert
- Monitoring Studio: Executing Commands in Windows PowerShell Using the Command-line Analysis Tool
- Monitoring Disk Space on UNC Mounted Drives using Monitoring Studio
- Prevent Storage KMs from creating agent thresholds, when configured in CMA mode