Hitachi

JP1 Version 11 JP1/Performance Management - Agent Option for Service Response Description, User's Guide and Reference


jpcvtest (executes measurement tests)

Organization of this page

Format

Format 1

jpcvtest -wtfile Web-transaction-file-name -wtname Web-transaction-name [ -t timeout-period (seconds)] [-s] [-v]

Format 2

jpcvtest -n measurement-condition-ID [-s] [-v]

Function

The functions and usage patterns of each format of the jpcvtest command are described below. For details about measurement test usage patterns, see 2.1.3 Web transaction measurement test.

Format 1

Based on the Web transaction and timeout period specified as arguments, this command immediately executes a measurement test and outputs measurement results to the standard output.

The Web transaction file name and Web transaction name that are used for a measurement test are directly specified as arguments.

Use this format when conducting a measurement test for Web transactions that are not defined in the measurement condition registration file. The main usage patterns for this format are shown below.

  • Verifying whether Web transactions can be measured using a Web transaction file that is created when the product is installed

  • Preliminary checking of a new Web transaction file that is created before it is registered in the measurement condition registration file, while production operations are in progress

Format 2

This command immediately executes a measurement test for a Web transaction with the measurement condition ID specified as an argument and outputs measurement results to the standard output.

A measurement test is executed by reading definition information (a Web transaction file name, Web transaction name, and timeout period) related to the measurement condition ID specified as an argument from the measurement condition registration file (esptask.xml). If the measurement target with the specified measurement condition ID is not a Web transaction, the measurement result is output as an error. Note that this format cannot be used on a standby node in a cluster environment.

Use this format when conducting a measurement test for an existing Web transaction that is defined in the measurement condition registration file. This format can be used in an environment where Web transactions are measured using PFM - Agent for Service Response, in the following situations:

  • To verify whether Web transactions can be measured after Web content or server settings on the monitored server are changed

  • To verify whether Web transactions can be measured after the definitions for PFM - Agent for Service Response (such as definitions in a Web transaction file, measurement conditions, passwords, and authentication information in a certificate file) are changed

  • To check whether the monitored server is operating when there are no changes to the settings or definitions

There are notes about using this format. See 1 in Notes below.

Execution permission

Administrator permissions

Storage folder

installation-folder\agtv\probe\bin

Arguments

-wtfile Web-transaction-file-name

Specifies the name of the Web transaction file to be used for a measurement test.

Specify a file with an .xml extension that is stored in installation-folder\agtv\probe\webtrans. When specifying a file name, include the file's extension, but not its path. File names are not case-sensitive. File names that contain spaces must be enclosed in double quotation marks (").

-wtname Web-transaction-name

Specifies the name of the Web transaction to be subject to a measurement test. Vertical bars (|) cannot be used as part of a Web transaction name. Web transaction names that contain spaces must be enclosed in double quotation marks (").

Note that the Web transaction name specified here corresponds to the value specified in the following locations:

  • For Web Recorder

    New Web transaction name in the Create New Web Transaction window, or New Web transaction name in the Save As window

  • For Web transaction file

    <TRANSACTION_NAME> tag

  • For Measurement condition registration file

    <TRANSACTION_NAME> tag

-t timeout-period

Specifies a timeout period for measurement test execution in the range from 1 to 3,600 (seconds). If this argument is not specified, the default value is 30.

Note that the timeout period specified here corresponds to the value of the <TIMEOUT> tag in the measurement condition registration file.

-n measurement-condition-ID

Specifies the measurement condition ID registered in the measurement condition registration file.

You can specify as many measurement condition IDs as there are Web transactions (specified in the <WEBTRANS> tag) subject to measurement.

-s

Outputs measurement results for each scope.

-v

Outputs information required for investigating error causes (information other than measurement results, such as HTTP requests and response headers).

This information can be used to investigate causes when an error occurs during a measurement test.

Notes

  1. PFM - Agent for Service Response performs a syntax check when the service is started or reloaded. If a syntax error# is found in the Web transaction file registered in the measurement condition registration file, other measurements by the probe also stop. This is because the Extensible Service Probe service (for measuring response performance) stops when the PFM - Agent for Service Response service is started or reloaded

    For this reason, watch out for syntax errors when executing the jpcvtest command in format 2. When you create a new Web transaction file, we recommend that you check for any syntax errors by executing the jpcvtest command in format 1 before registering the Web transaction file in the measurement condition registration file. When you modify an existing Web transaction file, we also recommend that you check for any syntax errors by executing a measurement test before starting or reloading the service.

    #

    Syntax errors include the following cases: XML tags contain errors, or no password is set even though the user to be authenticated is specified (including cases where a password has not been correctly registered with the esppasswd command).

    For details about the format of a Web transaction file, see 8.5 Web transaction files.

  2. Multiple instances of the jpcvtest command cannot be executed at the same time. If multiple instances of this command are executed at the same time, the execution results of all the instances except the first one are indicated as an error.

  3. If the test measurement by the jpcvtest command conflicts with test measurement by the probe, the jpcvtest command does not suppress the conflict but follows the specifications on the monitoring target. For example, if there is a restriction that prevents the monitored Web page from being accessed simultaneously, the measurement fails.

  4. If you change the definitions for PFM - Agent for Service Response before executing the jpcvtest command, back up the definition files to be changed beforehand.

  5. If the jpcvtest command is executed in format 1, and a message with a measurement condition ID is output, the measurement condition ID is indicated as 0.

Return values

0

Normal termination

1

An error with an argument or definition was found during command execution, or operations could not continue due to a memory shortage.

Error details are also output in a message.

2

The measurement test executed by the command resulted in an error.

Error examples:

  • The monitored server is stopped.

  • The Web service is stopped.

  • The resource specified by the URL does not exist (HTTP 404 error).

  • An authentication error occurs.

  • A response determination error occurs.

Error details are also output in a message.

3

Multiple instances of the command were executed at the same time.

Result report format

#1

For details about service type IDs, see Table 10-12 Service type IDs.

#2

For details about result codes, see Table 10-11 Result code.

Example 1 (executing a measurement test)

Three examples of using this command are shown below, based on the definitions in the following Web transaction file (wtdemo.xml):

<?xml version="1.0" encoding="Shift_JIS" standalone="no"?>

<!DOCTYPE TRANSACTION_LIST SYSTEM "espwebtrans.dtd">

<TRANSACTION_LIST>

<TRANSACTION>

<TRANSACTION_PARAM>

<TRANSACTION_NAME>wtdemo1</TRANSACTION_NAME>

</TRANSACTION_PARAM>

<STEP>

<TITLE>Web transaction test command demo page</TITLE>

<REQUEST>

<URL>http://testmachine1/~test/jp1pfm/SRmemo/wtdemo/wtdemopage1/index.php</URL>

</REQUEST>

</STEP>

<STEP>

<TITLE>page1</TITLE>

<REQUEST>

<URL>http://testmachine1/~test/jp1pfm/SRmemo/wtdemo/wtdemopage1/success.php</URL>

</REQUEST>

</STEP>

<STEP>

<TITLE>Web transaction test command demo page</TITLE>

<REQUEST>

<URL>http://testmachine1/~test/jp1pfm/SRmemo/wtdemo/wtdemopage1/index.php</URL>

</REQUEST>

</STEP>

</TRANSACTION>

</TRANSACTION_LIST>

In the following command usage example, a measurement test is executed for the Web transaction called wtdemo1 in the above Web transaction file (wtdemo.xml).

jpcvtest -wtfile wtdemo.xml -wtname wtdemo1

If a measurement test is executed and succeeds, the following result report is output:

KAVK08333-I Web transaction test has started.

KAVK08334-I Web transaction test has succeeded. ResultCode=0

== Test report ==========================

Web Transaction Filename: wtdemo.xml

Web Transaction Name: wtdemo1

Service Type ID: 110

Measurement Start Time: 2014/06/18 19:46:52

Measurement End Time: 2014/06/18 19:46:52

Result Code: 0

=========================================

KAVK08336-I Web transaction test has ended.

KAVK42005-I The command was successfully executed.

If a measurement test is executed, and an error is indicated in the measurement result, an error message is also output as in the following output example. In this example, an HTTP request failed. For details about the descriptions and actions to take for the messages that are output, see 12.4 Messages.

KAVK08333-I Web transaction test has started.

KAVK08261-E The requested resource was not found. ID=0,Service_type=WEBTRA

NS,URL=testmachine1/~test/jp1pfm/SRmemo/wtdemo/wtdemopage1/success.php

KAVK08341-E A HTTP response was failed.ID=0,STATUS_CODE=404

KAVK08335-E Web transaction test has failed. ResultCode=3

== Test report ==========================

Web Transaction Filename: wtdemo.xml

Web Transaction Name: wtdemo1

Service Type ID: 110

Measurement Start Time: 2014/06/18 19:25:13

Measurement End Time: 2014/06/18 19:25:13

Result Code: 3

=========================================

KAVK08336-I Web transaction test has ended.

KAVK42004-E An attempt to execute the command has failed.

Example 2 (collecting information to check the cause of the error detected by a measurement test)

By executing the command with the -v option specified, you can output information that can be used to investigate the cause of the error detected by a measurement test. (This information is any information other than measurement results, such as HTTP requests and response headers.) A command usage example is as follows:

jpcvtest -wtfile wtdemo.xml -wtname wtdemo1 -v

Based on the case where an HTTP request failed as shown in Example 1 (executing a measurement test), the following section explains how to investigate error causes according to the information output by the -v option.

Here, assume that the browser can successfully access the URL (success.php) defined in the Web transaction file when the measurement test detects the error that causes the HTTP request to fail.

When the command is executed with the -v option specified, the following information is output:

Item

Format

Pad character

Step information

** Step(No.AAAA) ***************************

STEP ID : BBBB

AAAA: Step number (1,2,3....)

BBBB: Step ID

If there is no step information, the STEP ID line is omitted.

Resolve address

Resolve address "AAAA"->"BBBB"

AAAA: Host name (IP address if an IP address is specified)

BBBB: IP address

HTTP request message

HTTP Request {

AAAA

}

AAAA: HTTP request message

Multiple lines are output. Code \r\n is converted to a line break.

HTTP response header

HTTP Response {

AAAA

}

AAAA: HTTP response header

Multiple lines are output. Code \r\n is converted to a line break.

Step response time

Step response time: AAAA sec.

AAAA: Step response time

The following is an example of command output with the -v option specified. HTTP request and response header information is output separately for each step.

KAVK08333-I Web transaction test has started.

** Step(No.1) ***************************
Resolve address "testmachine1"->"172.16.233.12"
HTTP Request {
    GET /~test/jp1pfm/SRmemo/wtdemo/wtdemopage1/index.php HTTP/1.0
    Host: testmachine1:80
    Connection: close
    User-Agent: PFM - Agent for Service Response (Windows)
    Accept: */*
}
HTTP Response {
    HTTP/1.1 200 OK
    Date: Wed, 18 Jun 2014 10:30:55 GMT
    Server: Apache/2.0.52 (Red Hat)
    X-Powered-By: PHP/4.3.9
    Content-Length: 548
    Connection: close
    Content-Type: text/html; charset=none
}
Step response time :0.084 sec
** Step(No.2) ***************************
Resolve address "testmachine1"->"172.16.233.12"
HTTP Request {
    GET /~test/jp1pfm/SRmemo/wtdemo/wtdemopage1/success.php HTTP/1.0
    Host: testmachine1:80
    Connection: close
    User-Agent: PFM - Agent for Service Response (Windows)
    Accept: */*
}
HTTP Response {
    HTTP/1.1 404 Not Found
    Date: Wed, 18 Jun 2014 10:30:55 GMT
    Server: Apache/2.0.52 (Red Hat)
    X-Powered-By: PHP/4.3.9
    Content-Length: 0
    Connection: close
    Content-Type: text/html; charset=none
}

KAVK08261-E The requested resource was not found. ID=0,Service_type=WEBTRA

NS,URL=testmachine1/~test/jp1pfm/SRmemo/wtdemo/wtdemopage1/success.php

KAVK08341-E A HTTP response was failed. ID=0, STATUS_CODE=404

KAVK08335-E Web transaction test has failed. ResultCode=3

== Test report ==========================

Web Transaction Filename: wtdemo.xml

Web Transaction Name: wtdemo1

Service Type ID: 110

Measurement Start Time: 2014/06/18 19:30:55

Measurement End Time: 2014/06/18 19:30:55

Result Code: 3

=========================================

KAVK08336-I Web transaction test has ended.

KAVK42004-E An attempt to execute the command has failed.

In the above output example, the first step succeeded with HTTP status code 200 (OK), while the second step accessed success.php and received status code HTTP404 (Not Found) from the monitored server (testmachine1).

This fact clarifies the following two points:

  1. The browser was able to successfully access the URL (success.php) defined in the Web transaction file.

    The resource for success.php exists on the monitored server.

  2. Both the first and second steps sent HTTP request messages to the same monitored server (testmachine1), and the only difference between them is the URLs that they accessed (index.php and success.php). When success.php was accessed, an HTTP404 error occurred.

    It is very likely that the content of success.php itself could have been the cause of an HTTP404 error.

Now, if we look at the content of success.php (which resulted in an HTTP404 error) on the monitored server, we find that the URL page has the following restriction: the page references the User-Agent section of each HTTP request message sent to the monitored server, and returns an HTTP404(Not Found) error to requests received from any browsers other than Internet Explorer. (Note that the following content of success.php is just a sample for explaining this usage example.)

The restriction imposed on this page cannot be avoided by using the content of the standard User-Agent settings.

<?php

$ua=$_SERVER['HTTP_USER_AGENT']; // Indicates the User-Agent section of each HTTP request message.

// for Internet Explorer(Trident) only

// Returns an HTTP404 error to requests from any browsers other than Internet Explorer.

if (strpos($ua,"Trident"#)==false) {

header("HTTP/1.1 404 Not Found");

exit();

}

?>

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

<html>

<head>

:

#

Trident is an HTML rendering engine that is incorporated into Internet Explorer. An HTML rendering engine is a program that interprets data written in a Web page description language and computes the layout of text and images that are displayed on the screen.

To make HTTP requests from PFM - Agent for Service Response and avoid the restriction imposed on this page, you need to change the User-Agent settings to match the contents of HTTP requests from Internet Explorer. As shown in the following setting example, you can use a method to set the <USER_AGENT> tag in the Web transaction file. For details about how to set the <USER_AGENT> tag, see 8.5.2(1) <TRANSACTION_PARAM> tag.

Example 3 (checking measurement test results separately for each scope)

To check measurement results not only for the entire Web transaction but also for individual scopes that are user-defined in Web Recorder, execute the command with the -s option specified, as follows:

jpcvtest -wtfile wtdemo2.xml -wtname wtdemo2 -s

The following output example shows the information output for individual scopes.

The information output under (scopeALL) indicates the measurement test results for the entire Web transaction, while the information output under (scope1) and (scope2) indicates the measurement test results for the individual scopes.

KAVK08333-I Web transaction test has started.

KAVK08334-I Web transaction test has succeeded. ResultCode=0

== Test report ==========================

Web Transaction Filename: wtdemo2.xml

Web Transaction Name: wtdemo2

Service Type ID: 110

Measurement Start Time: 2014/06/18 20:01:14

Measurement End Time: 2014/06/18 20:01:14

Result Code: 0

-- (scopeALL) -----------------

Total Response Time: 0.102 ... Total response time (seconds)

Setup Time: 0.027 ... Setup time (seconds)

HTTP Time: 0.073 ... HTTP time (seconds)

DNS Time: 0.002 ... DNS time (seconds)

TCP Connection Time: 0.024 ... TCP connection time (seconds)

Server Processing Time: 0.045 ... Server processing time (seconds)

Data Transfer Time: 0.024 ... Data transfer time (seconds)

Total Amount of Data: 15051 ... Total amount of data (bytes)

Request Count: 15 ... Number of request (counts)

Total Resource Size: 7576 ... Total resource size (bytes)

Throughput: 2525.33 ... Throughput (bits/second)

-- (scope1) -----------------

Total Response Time: 0.019

Setup Time: 0.009

HTTP Time: 0.01

DNS Time: 0

TCP Connection Time: 0.009

Server Processing Time: 0.006

Data Transfer Time: 0.003

Total Amount of Data: 1993

Request Count: 2

Total Resource Size: 1004

Throughput: 2677.33

-- (scope2) -----------------

:

-- (scope8) -----------------

Total Response Time: 0

Setup Time: 0

HTTP Time: 0

DNS Time: 0

TCP Connection Time: 0

Server Processing Time: 0

Data Transfer Time: 0

Total Amount of Data: 0

Request Count: 0

Total Resource Size: 0

Throughput: 0

=========================================

KAVK08336-I Web transaction test has ended.

KAVK42005-I The command was successfully executed.