NetCrunch Knowledge Base

How-tos, troubleshooting and answers about NetCrunch.

How to create a new network service definition (7.x-8.x)

Applies to 8.x 7.x

Node Settings->Network Services-> Add service->Create New Service Definition

NetCrunch offers the following possibilities to create a new network service definition:

Duplicating an existing service definition

This option allows duplicating a network service available in NetCrunch.

Creating a new service from scratch

When this option is selected the Service Editor window is opened where the user can define the request and response patterns for a newly created service.

Creating a simple TCP port checking service

This option allows creating a simple port checking service. The user needs to enter the desired service name, TCP port and a short description in the Create Simple Port Checking Service window. Once the new port checking service is created it is added to the network services list.

Once, the new service has been created, it is listed in the Name field of the Add New Service window along with all network services available in the program.

Creating a new network service definition from scratch
  1. Select the Create from Scratch option. The Service Editor window opens.
  2. Enter the new service name in the Protocol/Service Name field.
  3. Select the protocol type (UDP, TCP, or IPX) for the new service using the Protocol Type drop down list.
  4. Enter the port number for the new network service in the Port data field.
  5. Enter a short description about the new network service you are defining in the Description field.
  6. Define a request that is to be always sent to the network service to test its status. See the section entitled Defining Request, below, for more information.
  7. Define the expected patterns that are to be matched to the received response from the new network service. See the section entitled Defining Response, below, for more information.
Defining Request
  1. From the Service Editor window select the Request tab.
  2. From the Send drop-down list select the format in which the request data is to be in (text or hexadecimal).
  3. In the field below type in the exact request that is to be sent each time to test the network service status.
  4. If you plan to set a delay during sending of the request, select the Delay Sending Request Data check box.
  5. When defining a request you must specify the exact data to be sent by NetCrunch to test the state of this new network service.

You can specify and send the request data in text or hexadecimal format. In addition, to assist in proper functioning of this feature, you can indicate to set a delay during sending of each request.

Defining Response

Defining a response consists of creating a pattern or set of patterns that matches (or does not match) expected response from the new network service.

You can indicate the response to be valid when any defined pattern matches, when all patterns match or none of the patterns match.

You create each pattern separately in the Response Pattern Properties window by entering proper information in a logical condition statement. You must also specify the format of the condition pattern to be text, hexadecimal or regular expression type.

The condition statement that you specify varies depending whether it is text/hexadecimal or regular expression type.

For the first two types, you must indicate the following information:
Starting Byte Comparison Position
Specifies from which byte of the response, the pattern is to be exactly matched or searched.
Starts With/Does Not Start With/Contains/Does Not Contain/Is Greater Than/Is Lower Than
Specifies the logical relationship between the response and exactly matched or searched pattern. Please notice that the program checks the response pattern starting from the byte specified by the user. The program checks only the number of bytes specified by the user in the response pattern. Checking is continued until the first byte matches the condition entered by the user. In the case of selecting Contains/Does Not Contain condition, the user can specify the maximum number of bytes to be processed while checking the response.
Pattern
Specifies the actual pattern (for example, 'ABCD123') that is to be exactly matched or searched within the received response. If the hexadecimal format is selected, the two characters of the response pattern, entered by the user, represent a single byte. For the selected text format, a single character represents one checked byte of response (ASCII representation).

For the latter case, the regular expression type, you must indicate the following information in the condition statement:

Starting Byte
Specifies the starting byte position of the response that the regular expression is to be searched from.
Ending Byte
Specifies the ending byte position of the response that the regular expression is to be searched until.
Pattern
Specifies the actual regular expression to be matched in the response.

To define a response:

  1. From the Service Editor window click the Response tab.
  2. In the Valid When drop-down list select proper pattern matching type (any, all or none). 3.Click the Add Pattern icon. The Response Pattern Properties window opens.
  3. In the Format field enter the format of the pattern that will be compared to the received response from the new network service.
  4. In the Condition field enter the proper information (as described in the tables, above).
  5. Click OK.The defined pattern is now displayed in the table.
  6. Repeat steps 3 through 6 to define another pattern to be compared to the response.

Note: You can easily edit or delete already defined pattern conditions that are listed in the table. Just select the pattern condition from the table and click the Edit or Delete icons, respectively.

Regular expressions allow you a very flexible and advanced manner of searching for patterns in a data string. However, detailed description of this subject is beyond the scope of this help file. To learn more about creating regular expressions, visit a Web site such as Regular-expressions.info.

Once you are done defining all the patterns, you can easily verify whether it works correctly by clicking the Test button in the Service Editor window. The Test Response Patterns window opens where you can type in the expected service response and click the Test button to see whether the defined patterns are successful matching it or not.

NetCrunch. Answers not just pictures

Maps → Alerts → Automation → Intelligence