FTP and FTPS server (ftp)
Connects to an FTP server, optionally protected with explicit FTPS (AUTH TLS) or implicit FTPS, signs in, and measures how long that takes. It can also look at one file (does it exist, how big, how old) or one folder (how many files, how big, how old is the newest), which is the "did the upload arrive" check. It reads only: it never uploads, deletes or renames.
What it looks like

The page of an FTP sensor after a few polls, using explicit FTPS and counting the files of a folder on a lab server. In the dark theme: the sensor's page. The form for adding it, with its parameters filled in: light, dark.
Channels
| Key | Name | Unit | Default limits |
|---|---|---|---|
connect_ms | Connect time | ms | warning above 1000, error above 3000 |
login_ms | Time until signed in (connecting, TLS and the login) | ms | warning above 3000, error above 8000 |
response_ms | Response time (signing in and looking at the item) | ms | warning above 5000, error above 15000 |
exists | Exists (with item) | error below 1 (0 is Missing, 1 is Present) | |
age_s | Age (the file, or the newest file in a folder) | s | warning above 26 hours (93600), error above 48 hours (172800) |
size_bytes | Size (the file, or all counted files in a folder) | B | none |
file_count | Files (folders only) | error below 1 | |
cert_days_remaining | Days until the certificate expires (with TLS) | days | warning below 21, error below 7 |
chain_days_remaining | Days until the earliest expiry in the chain (with TLS) | days | warning below 21, error below 7 |
A missing file or folder is not a failed poll: it is a reading. exists is 0 and the age and size are unknown, so the default limit turns the sensor Down and the message says what was missing. A folder with no file in it, or none that matches the filter, gives file_count 0. That is the case of a backup that did not run. Only the files directly in a folder are counted, not those in its sub-folders. The age is measured from the last change time the server reports to the probe's clock, so a probe whose clock is wrong makes every age wrong; keep it on NTP. A file stamped in the future is as new as can be (age 0). The default limits suit a daily backup; change them on the sensor for anything else, as described for win_file.
The certificate is read from the connection the sensor itself made, also when it is untrusted and the sensor runs with verify_tls off or a pin; an expired certificate that is accepted that way makes the sensor Down, as for the HTTP sensors.
Parameters
| Parameter | Default | Meaning |
|---|---|---|
port | 21, or 990 with security tls | TCP port. |
security | none | none, starttls (explicit FTPS: AUTH TLS, then PBSZ and PROT P so that the data connection is protected as well) or tls (implicit FTPS). |
passive | true | The server opens the data connection, the usual way through firewalls. Off for active mode, where the server connects back to the probe. |
anonymous | false | Sign in as anonymous instead of with the login credential. |
allow_plaintext_login | false | Allow a login without starttls or tls, which sends the password in the clear. |
item | none | file or folder. Without item and path the sensor only signs in. |
path | none | The file or folder, relative to where the login starts (the root of a chrooted account) or absolute. Needed with item. |
filter | none | Folders only. Count only the files whose name matches: * is any run of characters and ? is one, case ignored (*.bak). It is matched against the file name. |
verify_tls, tls_fingerprint, server_name, check_certificate | as for SMTP | The certificate rules. |
Suggested interval: 300 seconds. Credential: an optional login credential; it is required unless anonymous is on.
Passive data connections go to the address the control connection is talking to, not to the address the server names in its reply, so a server behind address translation that names its inner address still works.
On the target
An account that can list and read the folder. Folders are listed with MLSD where the server has it, and with LIST otherwise (vsftpd, for one, has no MLSD); the age of the newest few files from a LIST is then read exactly with MDTM, since a listing only shows the minute. A single file is read with SIZE and MDTM. Times are taken as UTC.
Servers that require the data connection to resume the TLS session of the control connection (vsftpd's require_ssl_reuse, on by default) are served as far as the TLS library allows session resumption; if a folder listing fails there with a data connection error, set require_ssl_reuse=NO on the server.
Failures
| Message | Meaning |
|---|---|
a refused connection (kind unreachable), a timeout (kind timeout) | The service is not listening, a firewall drops the traffic, or a data connection could not be made (for passive mode, check the server's passive port range). |
the server rejected the login: ... (kind auth_failed) | The user name or password is wrong, or anonymous access is not allowed. |
TLS error: ... (kind protocol) | The certificate is refused, or the port does not speak TLS (implicit FTPS on an explicit port, or the reverse); the message says which. |
<path> is a folder; set item to folder ... (kind config) | item is file and the path is a folder. |
Testing
The live tests in crates/probeward-sensors/tests/mail_ftp_live.rs need PROBEWARD_TEST_FTP_HOST, PROBEWARD_TEST_FTP_NAME (the name the certificate carries), PROBEWARD_TEST_FTP_USER, PROBEWARD_TEST_FTP_PASSWORD, PROBEWARD_TEST_FTP_CA_FILE (PEM) and PROBEWARD_TEST_FTP_FOLDER (a folder of the account holding file-0d.txt, file-1d.txt, file-7d.txt and file-30d.txt, 0, 1, 7 and 30 days old), and skip cleanly without them. The client against a small server on the loopback interface (MLSD, LIST with MDTM, missing files and folders, login failures) is in tests/ftp_proto.rs.