|
The Command Line Analysis tool enables you to remotely execute, run, and verify commands and scripts. You can then run string searches or extract numeric values on the monitored commands/scripts.
What you can do with this tool
The aim of this tool is to remotely execute a command line and parse its output. You may have an in-house script or command that you need to run and analyze at regular intervals in order to monitor an application. You can configure Monitoring Studio Express to:
| • | Remotely execute a command line and parse the output of this command |
| • | Execute on remote elements a script or command line utility stored on the RSM (the script or command line utility needed by the command line is transferred to the elements prior to its execution) |
| • | Verify the status of the execution |
| • | Fine-tune the monitoring by searching for strings or numerical values |
How it works
On Windows systems, BMC Performance Express Monitoring Studio, uses the WMI protocol by default, while on UNIX/Linux systems you have the choice to select between using Telnet or SSH protocols.
The basic steps to remotely execute a command are:
| 1. | Add the remote command execution application class to an element/element profile |
| 2. | Enter the connection credentials |
| 3. | Enter the command to be executed |
| 4. | Set/modify alert thresholds |
| 5. | The remote command execution instance is created and the monitoring begins. |
Command Execution
Behind the scenes on Windows
On the creation of an instance:
| 1. | BMC Performance Manager Express Monitoring Studio connects to the remote element via WMI and creates a process using the Win32_Process class on the remote element to execute the command. |
| 2. | The output is saved temporarily in a file on %SystemRoot%\sen_ms and a share is created on this folder. |
| 3. | Monitoring Studio Express then copies the content of the output file and stores it on the RSM at: %RSM_HOME%\RSMxx\server\rsm\tmp\deploy\. The temporary output file under sen_ms on the remote element is then deleted. |
| 4. | Monitoring Studio Express reads the output of the command from the file stored on the RSM under %RSM_HOME%\RSMxx\server\rsm\tmp\deploy\ and displays it in the ReturnOutput on the Portal. |
| 5. | As soon as the ReturnOutput parameter displays the content in the Portal interface, the temporary output file is deleted from the RSM. |
All the above steps take just a few seconds.
Behind the scenes on UNIX/Linux
BMC Performance Manager Express Monitoring Studio connects to the remote element using the Telnet or SSH protocols and the execution of a command on a UNIX/Linux platform is a straightforward procedure that warrants no additional "behind the scenes" information.
To execute on remote managed elements a script or command line utility stored on the RSM
| 1. | Ensure the presence of a folder called sen_ms on the RSM at %RSM_HOME%\RSMxx\; or create one. If a command has already been executed via the same RSM, then the folder will be present. (as explained in the section above) |
| 2. | Before adding the command line instance: Copy the script or command-line utility needed by the command line to the sen_ms folder. |
| 3. | During instance creation, enter the correct format for this command line execution: %{FromRSM:filename} argument1 argument2 etc. |
Behind the scenes on Windows
| 1. | On creation of the new command line instance with the syntax %{FromRSM:filename}, Monitoring Studio Express looks for this file on RSM_HOME%\RSMxx\sen_ms |
| 2. | Using WMI, the connection is established with the remote element and a folder called sen_ms is created (if not already present) at %SystemRoot% |
| 3. | Next, the "external files" are copied from the RSM and stored on the remote element under: %SystemRoot%\sen_ms and a share is created on this folder. |
| 4. | The command is executed on the remote element, and the output is copied to the RSM and then displayed in the ReturnOutput parameter as explained in the section above. |
Behind the scenes on UNIX/Linux
| 1. | On creation of the new command line instance with the syntax %{FromRSM:filename}, Monitoring Studio Express looks for the script file on RSM_HOME%\RSMxx\sen_ms. The script file needs to be a text file as the transfer of binary files is not supported. |
| 2. | Using Telnet or SSH, the connection is established and the file content is copied to the remote machine at: /tmp/sen_ms_RSMHostname_RemoteHostname_filename |
| 3. | The command is executed and the output is displayed in the ReturnOutput parameter as explained in the section above. |
Parameters
Details of parameters and alert conditions are stated in the Reference Guide.
|