41.3. FTP diagnostics, statistics and debug

41.3.1. FTP diagnostics

This command reports the current situation of the FTP resource:

[19:00:30] ABILIS_CPX:d d ftp

RES:Ftp -----------------------------------------------------------------------
       File_Transfer_Protocol_Server                                           
       STATE:ACTIVE            MAX-CLI:4
       -- Clients --------|--TOT CUR---|--TOT PEAK--|--SSL CUR---|--SSL PEAK--|
       CONNECTED          |           1|           1|           0|           0|
       LOGGED             |           1|            |           0|            |
       DATA-SESSION       |           0|           0|           0|           0|
       ------------------------------------------------------------------------
       -- Sessions states -----------------------------------------------------
       SES C-STATE C-LOC                 C-REM                 USER
           D-STATE D-LOC                 D-REM
       ------------------------------------------------------------------------
         1 LOGGED  192.168.029.254-21    192.168.020.104-43892 admin
           READY   000.000.000.000-0     000.000.000.000-0     

The meaning:

STATE

The FTP driver state:

  • INACTIVE - configuration parameter ACT:NO.

  • ACTIVE - The driver is fully ready to work.

MAX-CLI

How many client can be served simultaneously, for each of them the FTP server has reserved one session for COMMANDs and one for DATA. This counter does not make distinction between "plain" and "ssl" sessions.

CONNECTED

It shows the number of FTP-COMMAND session which are currently connected, including those not logged-in. This counter does not make distinction between "plain" and "ssl" sessions. It also correspond to the number of clients currently connected.

LOGGED

It shows the number of FTP-COMMAND sessions which are currently connected and for which already successfully executed the log-in. This counter does not make distinction between "plain" and "ssl" sessions. It also correspond to the number of clients currently connected and logged-in.

DATA-SESSION

It shows the number of FTP-DATA sessions which are currently established and on which the data transfer is proceeding or going to start. This counter does not make distinction between "plain" and "ssl" sessions. It also correspond to the number of clients currently sending or receiving with the FTP server.

TOT CUR

Total current sessions ("plain" and "ssl") CONNECTED/LOGGED/DATA-SESSION.

TOT PEAK

Total peak sessions ("plain" and "ssl") CONNECTED/DATA-SESSION.

SSL CUR

SSL current sessions CONNECTED/LOGGED/DATA-SESSION.

SSL PEAK

SSL peak sessions CONNECTED/DATA-SESSION.

SES

FTP session identifier.

C-STATE

Control session state:

  • STOPPED - stopped (configuration parameter ACT:NO).

  • READY - ready to work.

  • CONNECT - connection state and waits USER command.

  • WAITPWD - waits PASS command.

  • LOGGED - user is logged in.

D-STATE

Data session state:

  • READY - is ready.

  • LIST - sends list of the directory (full format).

  • NLST - sends list of the directory (short format).

  • STOR - receives file from FTP client.

  • STOU - receives file from FTP client and stores it to the unique file.

  • APPE - receives and appends file from FTP client.

  • RETR - sends file to the client.

C/D-LOC

IP address and port of the control/data connection on the local FTP server.

C/D-REM

IP address and port of the control/data connection on the remote FTP client, or on another FTP server.

USER

Logged FTP user.

41.3.2. FTP statistics

This command can help to understand what is happening, in case of troubles:

[19:01:14] ABILIS_CPX:d s ftp

RES:Ftp -----------------------------------------------------------------------
       File_Transfer_Protocol_Server                                           
       --- Cleared 0 days 10:27:46 ago, on 20/10/2017 at 01:06:13 -------------
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CTRL-CHR   |       1093|       5562|CTRL-PCK   |        142|        165|
       DATA-CHR   |          0|      23190|DATA-PCK   |          0|         38|
       COMMAND    |        142|           |REPLY      |           |        165|
       DENIED-IP  |          0|           |BANNED-IP  |          0|           |
       ------------------------------------------------------------------------
[19:02:03] ABILIS_CPX:d se ftp

RES:Ftp -----------------------------------------------------------------------
       File_Transfer_Protocol_Server                                           
       --- Cleared 0 days 10:27:48 ago, on 20/10/2017 at 01:06:13 -------------
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CTRL-CHR   |       1093|       5562|CTRL-PCK   |        142|        165|
       DATA-CHR   |          0|      23190|DATA-PCK   |          0|         38|
       COMMAND    |        142|           |REPLY      |           |        165|
       DENIED-IP  |          0|           |BANNED-IP  |          0|           |
       ------------------------------------------------------------------------
       SES C-STATE C-LOC                 C-REM                 USER
           D-STATE D-LOC                 D-REM
       ------------------------------------------------------------------------
         3 LOGGED  192.168.029.254-21    192.168.020.107-49253 admin
           READY   000.000.000.000-0     000.000.000.000-0     
       -----------|---INPUT---|--OUTPUT---|-----------|---INPUT---|--OUTPUT---|
       CTRL-CHR   |        986|       5154|CTRL-PCK   |        132|        151|
       DATA-CHR   |          0|      22947|DATA-PCK   |          0|         37|
       COMMAND    |        132|           |REPLY      |           |        151|
       ------------------------------------------------------------------------

With reference to the shown interval of time («Cleared 0 days 10:27:48 ago») these counters show the number of:

CTRL-CHRCharacters received/sent by all control sessions from TCP.
CTRL-PCKPackets received/sent by all control sessions from TCP.
DATA-CHR Characters received/sent by all data sessions from TCP.
DATA-PCKPackets received/sent by all data sessions from TCP.
COMMANDFTP commands that any control session recognised in the incoming TCP stream.
REPLYFTP replies that any control session sent into the outgoing TCP stream.
DENIED-IPFTP requests received by the server from not allowed source IP address. The not-allowed is a client whose IP address is not present in IPSRC and IPSRCLIST parameters configuration.
BANNED-IPRequests that was discarded because the source IP was banned by IPBAN service.
[Note]Note

The d se ftp command shows statistic information in an extended format including shown for each session.

41.3.3. FTP debug

Type the following command to view the commands allowed:

[15:29:42] ABILIS_CPX:debug res:ftp

RES:Ftp -----------------------------------------------------------------------
       File_Transfer_Protocol_Server                                           
       BufferLength:64512  Date/Time:20/10/2017 12:43:52 TraceTime:41859721

Usage:
   LSN:0            - This help
   LSN:1            - Complete debug
   LSN:2            - Statistics
   LSN:3            - Session log
   LSN:3 CMD:CLR    - Clear session log
   LSN:3 CMD:SES:x  - Shows events only for session "x"
[Note]Note

To use these commands you need to have administrator or super user rights.

Type the following command to view the FTP session log:

[15:34:42] ABILIS_CPX:debug res:ftp lsn:3

RES:Ftp -----------------------------------------------------------------------
       File_Transfer_Protocol_Server                                           
       BufferLength:64512  Date/Time:20/10/2017 12:44:52 TraceTime:41919655

20/10 12:07:30 [  3] Reply:200 Type set to BINARY
20/10 12:07:32 [  3] Command: TYPE A
20/10 12:07:32 [  3] Reply:200 Type set to ASCII
20/10 12:07:32 [  3] Command: PASV
20/10 12:07:32 [  3] Reply:227 Entering Passive Mode (192,168,29,254,48,36)
20/10 12:07:32 [  3] Command: LIST -a
20/10 12:07:32 [  3] DATA open PASV L:192.168.29.254:12324 R:192.168.20.107:49325
20/10 12:07:32 [  3] Reply:150 Opening ASCII SSL data connection for directory list
20/10 12:07:32 [  3] Reply:226 Transfer complete
20/10 12:07:32 [  3] Transfer complete. 243 bytes was sent
20/10 12:08:06 [  3] Command: TYPE I
20/10 12:08:06 [  3] Reply:200 Type set to BINARY
20/10 12:08:32 [  3] Command: PWD
20/10 12:08:32 [  3] Reply:257 "/" is current directory
20/10 12:08:57 [  3] Command: PWD
20/10 12:08:57 [  3] Reply:257 "/" is current directory
20/10 12:09:28 [  3] Command: TYPE A
20/10 12:09:28 [  3] Reply:200 Type set to ASCII
20/10 12:09:28 [  3] Command: PASV
20/10 12:09:28 [  3] Reply:227 Entering Passive Mode (192,168,29,254,50,37)
20/10 12:09:28 [  3] Command: LIST -a
20/10 12:09:28 [  3] DATA open PASV L:192.168.29.254:12837 R:192.168.20.107:49327
20/10 12:09:28 [  3] Reply:150 Opening ASCII SSL data connection for directory list
20/10 12:09:28 [  3] Reply:226 Transfer complete
20/10 12:09:28 [  3] Transfer complete. 243 bytes was sent