A script-enabled browser is required for this page to function properly.

Create / Edit Service Test - Custom Script Page

Use this page to define a custom test for a service. You can specify a script or executable that will test the service. The script will be run using the supplied user credentials.

Test Parameters

Parameter

Description

Command Line

This indicates the command line for the script.

Username / Password

These are the operating system credentials under which the script will be run.

Number of Retries

This is the number of times that a script will be run (if it returns non-zero) until the status is determined to be down.

Retry Interval

This is the interval between consecutive retries.

Timeout

This is the amount of time that the agent will wait for the test to complete. If the timeout expires, then the status of the test will be considered down.

Metrics Collected

Metric Description
Status Indicates the status of the service test. The test is successful of the return code of the script is 0.
Total Time Indicates the total time required to run the script.
Custom Metric 1 - 10 These correspond to each line generated by the script.

Usage Tips

Example

A sample perl script is given below. Create a perl script called "/usr/bin/perltest.pl":
#
# A perl script that always returns the same metric values.
#
print "100\n";
print "200\n";
print "300\n";
print "400\n";
pritn "500\n";
exit 0;

Enter "perl /usr/bin/perltest.pl" on the Command Line.  Make sure that you have set the required permissions on "/usr/bin/perltest.pl" so that the Agent can run the script.  When the Agent executes the metric, a zero-value exit code is returned. This indicates that the status is up. The Total Time reflects the time taken to run the perl command. Custom Metrics 1 through 5 will contain the values 100, 200, 300, 400 and 500 respectively.

Related Topics

About Services

Types of Service Tests

Creating a Service

Enterprise Manager Information Roadmap