FTP Monitor

The FTP monitor tests FTP services by either uploading files to, or downloading files from FTP servers. It monitors the performance of the service by recording the response time and data transfer rate, and monitors disk space and file integrity.

Table 1. FTP monitor summary 
Monitor files Name or location
Monitor executable nco_m_ftp
Properties file $ISHOME/etc/props/ftp.props
Rules file $ISHOME/etc/rules/ftp.rules
Log file $ISHOME/log/ftp.log
Guidelines for configuring the FTP monitor

The FTP monitor tests the availability of an FTP server by uploading a file to the server using an FTP STOR command, or downloading a file from the server using an FTP RETR command.

Configuring FTP Monitor Service tests

The configuration parameters for the FTP monitor are described in the following table.

Table 2. FTP monitor configuration
Field Description
server The IP address of the target FTP server, or the machine you want to FTP from. Example is ftp.mycompany.com
localfile

For FTP GET operations, this field specifies the name and path to which the file is downloaded.

For FTP PUT operations, this field specifies the name and path of the file that is uploaded to the FTP server.

The default value is FULL PATHNAME. Example is $ISMHOME/etc/ism/downloads/ftp-test.tar.Z

remotefile

For FTP GET operations, this field specifies the name and path of the file that is downloaded from the server.

For FTP PUT operations, this field specifies the name and path to which the file is uploaded on the FTP server.

The default value is FULL PATHNAME. Example is /sales/prodlist.tar.Z

description A text field for providing descriptive information about the element.
port

The default port that the FTP server uses.

Default: 21

username The username used to log on to the target FTP server.
password The password used to log on to the target FTP server. Leave this blank if the FTP account doesn’t require a password.
command The FTP command for the monitor to use:
  • GET or RECV - Download a file from the target FTP server
  • SEND or PUT - Upload a file to the target FTP server

Default: GET.

conntype Specifies the type of connection for the monitor to establish with the server when it tries to transfer the file:
  • Active
  • Passive

Default: Active.

timeout

The time, in seconds, to wait for the server to respond.

Default: 30.

poll

The time, in seconds, between each poll.

Default: 300

failureretests The number of times to retest before indicating a failure.

Default: 0.

retestinterval

The time period in seconds to wait between each failure retest.

Default: 10.

Regular expression matching

You can perform a regular expression search on the information being downloaded by entering up to 50 different regular expressions. The FTP monitor attempts to match the contents retrieved to each of the regular expressions.

If a match for a specified regular expression is found, the matched lines (or as much as can fit in the monitor’s internal buffer) are returned in the corresponding $regexpMatchn element. If the regular expression matches more than once in the information downloaded, only the first match is returned. The status of each regular expression test is indicated by the $regexpStatusn elements. You can use the regular expression matches and their status information as criteria for service level classifications.

Regular expressions perform string matching on content downloaded during service tests. These expressions may contain one or more regular expression operators, which determine what content is matched by the expression.

Note: Regular expression syntax can be used to match strings on single lines only. Internet Service Monitoring can’t match strings that include new lines or carriage returns. Use multiple regular expressions to match strings that cover multiple lines. You can also use SLC rules to raise alarms based on the result of multiple regular expressions.
Table 3. Regular expression operators
Character Description
.

Matches any single character.

For example, the regular expression r.t matches the strings rat, rut, r t, but not root.

$

Matches the end of a line.

For example, the regular expression dog$ matches the end of the string it's a dog but not the string There are a lot of dogs.

^

Matches the beginning of a line.

For example, the regular expression ^When in matches the beginning of the string When in the course of human events but wouldn’t match What and When in the.

*

Matches zero or more occurrences of the character immediately preceding.

For example, the regular expression .* matches any number of any characters.

\

Treats the subsequent character as an ordinary character.

For example, \$ matches the dollar sign character ($) rather than the end of a line. Similarly, the expression \. matches the period character rather than any single character.

[]

Matches any one of the characters between the brackets.

For example, the regular expression r[aou]t matches rat, rot, and rut, but not rit.

Specify ranges of characters by using a hyphen.

For example, the regular expression [0-9] matches any digit.

You can also specify multiple ranges.

For example, the regular expression [A-Za-z] matches any letter case.

|

Matches phrases containing either of the conditions specified.

For example, him|her matches the line it belongs to him and the line it belongs to her, but doesn’t match the line it belongs to them.

Note: If you prefer the output data strings with curly braces{} or double quotes "" then you need to add an escape character backslash \ before every curly brace and double quote in the regular expression.

For example, if the data string is {"templates":true,"mongodb":true,"ldap":true,"ucd":true,"github":true}then the regular expression should appear as \{\"templates\":true,\"mongodb\":true,\"ldap\":true,\"ucd\":true,\"github\":true\}

Monitor elements

In addition to the test results common to all elements, the FTP monitor generates a set of test results containing data specific to FTP service tests.

Table 4. FTP monitor elements
Element Description
$bytesPerSec*(BytesPerSec) The average number of bytes transferred each second.
$bytesTransfered*
(BytesTransferred)
The number of bytes uploaded or downloaded.

$checksum

The Checksum element doesn’t normally provide meaningful values for
service level classifications because checksum values aren’t known when the profile element is created (the monitor calculates checksum values while tests are in progress). The $checksum and $previousChecksum monitor elements are intended for alert enrichment using the monitor's rules file.
$command*(FtpCommand) The FTP command issued by the monitor.
$connectionType*(FtpConnection) The type of data connection used. This can be ACTIVE or PASSIVE.
$connectTime*(ConnectTime) The time taken to connect to the FTP server.
$downloadTime The time taken to download the file.
$localFile*(FtpLocalFile) Full pathname of the file stored on the local host. This element is taken from the configuration file.
$lookupTime*(LookupTime) The time taken to look up the FTP server IP address.
$previousChecksum The PreviousChecksum element doesn’t normally provide meaningful values for service level classifications because checksum values are not known when the profile element is created (the monitor calculates checksum values while tests are in progress). The $previousChecksum and $checksum monitor elements are intended for alert enrichment using the monitor's rules file.
$regexpn The regular expression.
$regexpMatchn The contents of the line matching the regular expression.
$regexpStatusn The status of the regular expression match:
NONE - No regular expression checking is configured
MATCHED - A match was found for the regular expression
FAILED - A match wasn’t found for the regular expression
$remoteFile*(FtpRemoteFile) Full pathname of the file stored on the remote host (the FTP server). This element is taken from the configuration file.
$responseTime*(ResponseTime) The time taken after a connection is created until the first byte of the target file is received.
$status The status code returned by the FTP server.
$transferTime*(TransferTime) Sets the value to $uploadTime or $downloadTime.
$uploadTime The time taken to upload the file.
$username User name (account name) used by the monitor to log in to the target host. This element is taken from the configuration file if $message contains OK.
Status messages

The FTP monitor provides status messages in the ResultMessage attribute when using IBM® Application Performance Management. These messages indicate the result of the test.

Table 5. FTP monitor status messages 
Message Description
OK The FTP request succeeded.
Unable to open local file for reading/writing See the FTP monitor log file for more information.
Unable to read from/write to local file
Unable to read from data connection A data connection to the FTP server was established, but a problem occurred.
Unable to upload to ftp server
Timed out waiting to read/write
Connection closed by foreign host The connection to the FTP server was broken.
Connection closed unexpectedly
Connection failed The monitor failed to connect to the FTP server. See the FTP monitor log file for more information.