Creating a Custom Command Monitor

How to

  1. Select Central > Monitors > New to create a new monitor.
  2. In the Server Group or Monitor page, give the new monitor a name.
  3. 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.
    Note: If you're not yet familiar with CloudTest's extensive monitoring capabilities, refer to Creating Monitor Server Groups before proceeding.
  4. On the System Resources page, scroll down and click Add Custom Object.
  5. Select Custom Command from the Select the resource type menu.
  6. In the Add a new Monitor Server Group or Monitor, System Resources page, check the Custom Command box in the Type column.
  7. In the Name column, enter a name to use for the monitor. For example, Shared DB Memory-PostgreSQL.
    Tip: Although this name is optional, it will appear on the widget title bar in any dashboard where the monitor is in display. Give each Custom Monitor a unique name so you can distinguish its purpose and the information being tracked at runtime.
  8. 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. #!/bin/bash top -b -n 1 | grep httpd | awk '{sum+=print $7} END {print sum}'
    Tip: You can also enter your script inline in the System Resource Selection page, but use this option only for very basic scripts that can be viewed in their entirety in the Arguments columns.
  9. On the Command Line, change the script's permissions to make it executable. For example: chmod a+x apache_shared_mem
  10. Enter the call to the script Monitor wizard's System Resource Selection. Note that the "./" preceding the script's name is required.
  11. Complete the monitor creation.
  12. At runtime, CloudTest will utilize a number returned from the given path.
  13. Click Next and then complete the creation of the Custom Monitor.

What you should see

The Name (Optional) value appears on the Monitor dashboard (as noted above).