Custom Commands can be used to create Custom Monitors in supported environments (all except Windows—support for which will be provided in the near future). Using this technique provides the ability to monitor runtime metrics (e.g. metrics whose value is not known ahead of time).
Custom Command monitors utilize an inline process call (entered into the provided Monitors box, text entry field) that executes a command inline or can refer to an external Shell Script accessible within the given environment.
Custom Command monitors require an agent, SOASTA Conductor, be in use as part of command configuration. This configuration is done using the existing Monitor UI, which now includes the Custom Command field, as well as a new Enable Custom Commands for Monitoring box is found in the SOASTA Conductor field, which appears in the Conductor Capabilities section under Allow Monitoring.
Both the Allow monitoring box, and the Enable Custom Commands for Monitoring opt-in box must be checked for subsequent monitor setup to succeed.
Once the opt-in boxes in the relevant SOASTA Conductor are checked, the remaining portion of the Monitor configuration follows the same workflow found in the setup of SOASTA-provided monitors.
Creating a Custom Command Monitor
- Create a new monitor using Central > Monitors > New.
- In the Server Group or Monitor page, give the new monitor a name.
- Ensure that the new monitor is associated with a Monitor Server Group setup for the host that will be monitored (shown below using the LibertyMonitorGroup).
Additionally, ensure that the Monitor Server Group's Connection Type has been set to the Conductor in use for the given host (e.g. as opposed to SSH).
If you're not yet familiar with CloudTest's extensive monitoring capabilities, refer to Creating Monitor Server Groups and Creating a Monitor before proceeding.
- On the System Resources page, scroll down and click Add Custom Object (the green Plus icon) and then select Custom Command from the drop-down.
- In the "Select resource type" dial that appears, select Custom Command.
- In the Add a new Monitor Server Group or Monitor, System Resources page, check the Custom Command box in the Type column.
- In the Name column, enter a name to use for the monitor. For example, Shared DB Memory-PostgreSQL.
- Next, create the external shell script to use on the machine to monitor.
For example, create a shell script called apache_shared_mem. This script will get the sum of shared memory for apache processes on the given machine.
- On the Command Line (e.g. as an Administrator on the monitored server), change the script's permissions to make it executable. For example:
- Enter the call to the script Monitor wizard's System Resource Selection. Note that the "./" preceding the script's name is required.
- Complete the monitor creation.
- At runtime, CloudTest will utilize a number returned from the given path.
- Click Next and then complete the creation of the Custom Monitor.
The Name (Optional) value appears on the Monitor dashboard (as noted above).