Using sample scripts for monitoring (Linux)

PATROL for Scripting enables you to use custom scripts to monitor your environment, and BMC provides some basic scripts to help you get started with the monitoring. You can create realistic and customizable scripts through an external scripting tool, and then configure them from a local or a remote computer and start the monitoring. For details about how to configure scripts, see Configuring remote scripts and Configuring local scripts.

This topic provides descriptions of the scripts that are provided by BMC and instructions for managing these scripts. For instructions about defining the script output, see Defining the script output.


When executing scripts, the KM requires the same user privileges as a real user would. For example: if you would normally require administrator-level privileges to access the monitored application, the KM requires the same level of privileges to run a script on that application.

The following topics are presented:

Using Sample scripts

Part 3 of this four-part video series introduces you to the sample scripts that are provided with the KM and the common use cases that they support. To view Part 2 in this series, see

Provided scripts

The following scripts are provided and cannot be deleted or replaced without administrator permissions:

Script name


Monitors cron jobs execution. The script runs on a host for which the root username and password have been provided. By setting a recurrent check on the /var/log/cron file the script reports the number of jobs that were executed during the last polling cycle. If the number is greater than zero, an annotation message is displayed with the job details. This script shows how to read the latest content from a file, for example, from the last 180 seconds.

conditional-monitor.shMonitors and collects data at the specified time. script

Monitors the network load per NIC by using the netstat command line tool. The script allows you to remotely monitor the network activity of a given host. The script uses the netstat -interfaces operating system command. The script accepts an argument of the host, and reports the network load of that host. The following attributes are provided:

  • bytes in (per NIC)
  • bytes out (per NIC)
  • packets dropped (per NIC)
  • packets overrun (per NIC)
  • packets error (per NIC)

It shows how to present delta values and average instead of absolute value into TrueSight Operations Management. script

Monitors network connectivity between a configured device (not where the PATROL Agent is running) and a third party device. This script allows the user to know the network response time between a defined host and a third party host. This script can prove helpful in an IT industry where there is a requirement to ensure that all the different gateways across all data centers can reach one another. The script uses ping (ICMP) in an unbuffered mode to test the connectivity. script

Monitors the NFS (Storage Area Network) service availability. The script is executed on a target NFS client host, and tests if the client can access the centralized SAN over NFS and automounter daemon. script

Monitors the network traceability by using the traceroute command line tool. You can run the script on Host A and provide an argument of Host B. The KM discovers all the network servers on the route Host A → Host B. The script monitors the response time of each server, which helps identify any bottlenecks on the route.

This script accepts an argument with the host name. While execution, it performs a traceroute action to that host, and instantiates parameters to show the performance and response times of all the different hosts in the chain of routers and switches. The instances are sorted according to the routing order and their FQDN or IP.

Provides information about the output format expected by the KM when multiple instances of the same monitor type are created. The script is like a sample hello world kind of script that displays a valid output with multiple instances and parameters.

Provides information about the output format expected by the KM for a single instance. The script is like a sample hello world kind of script that displays a valid output with a single value and an annotation.

hogging-process.shIdentifies the process with highest CPU utilization in percent.

Helps you set up monitoring of the remote Informix database.
Provides information about how to use Perl telnet and ping modules to setup monitoring of zOS systems by polling on their telnet service and requesting login per defined application name.

To view the list of available scripts


Script attributes of scripts provided by BMC do not support non-English characters.

  1. Navigate to $PATROL_HOME\..\TRO\Conf\Scripts\Samples.
  2. To modify the list, click the relevant column heading to sort the list based on a specific column. 
    To sort in reverse order, click the column heading again.

To add custom scripts

  • You can use scripts located from on your remote or local device. 
  • If the script does not exist on the remote device and is located on your local monitoring system, the script will be automatically copied to the Scripts folder. (%PATROL_HOME%/TRO/Conf/Scripts/DeviceName or %PATROL_HOME%/TRO/Conf/Scripts)

To delete scripts from the list


You cannot delete default scripts that are delivered with PATROL for Script KM. 

  1. Navigate to $PATROL_HOME\..\TRO\Conf\Scripts\Samples. 
  2. Select one or multiple scripts to delete and click the Delete button. 
  3. Click Yes in the confirmation message.
Was this page helpful? Yes No Submitting... Thank you