Sometimes it is necessary to monitor FTP servers for changes in the file structure. For example, you may need to track whether certain files are present on an FTP server, whether the specified file exceeds the preset sizes and, or vice versa, whether the contents of the file have been deleted (when the file size is 0), whether the specified file is updated with a specified time interval. And most importantly, you should always be aware of the availability of the FTP server that you use in the business processes of your company.

Every time you need to check the FTP server and files on it, it is inconvenient and time-consuming to launch an FTP client, login into the server, look for the required folder, and compare information about the file for changes. To accomplish such tasks as monitoring the FTP server for availability, file time stamp and size, use the Dotcom-Monitor Monitoring solution.

Dotcom-Monitor allows users to automatically check if the files on the FTP server folder are being updated by monitoring an FTP file time stamp. This can be useful for checking the performance of system health monitors or other logging applications. For example, you have an event logging application that adds entries to the event log and duplicates the content of the log every 15 minutes to a specific file on the FTP server. Dotcom-Monitor will check if changes were made in the file during the specified period of 15 minutes and if the file contains any data (the size exceeds the minimum allowed file size). If the file meets the monitoring requirements, it means that the logging application continues to properly record information about events and duplicate this data to the FTP server. Moreover, as a result of FTP monitoring, you will be sure that the FTP server is available and functioning correctly.

If the FTP server state changes or no file with the preset parameters was detected on the specified address, the Dotcom-Monitor alerting system will notify the user (SMS, Email, SNMP Alerts, Phone, PagerDuty, etc.) or generate a custom message to a third-party application (Custom Notification Script).

To set up FTP file time stamp and FTP traffic monitoring, create a Custom Script monitoring device and use the sftp_file_check.cs script.

Configuring FTP File Time Stamp Monitoring

The sftp_file_check.cs script performs connection to an FTP server, logging in, monitoring of specified file, and generates alerts if preset requirements are not met.

Custom Script File Arguments
sftp_file_check.cs “<FTP URL>” <list of file parameters to monitor>

FTP URL corresponds to the specification of URL formats, RFC 1738:

ftp://user:password@host:port/path

Some or all of the parts user:password@:password:port and /path may be omitted.

To monitor a particular file, specify a full path to the file, and use the following parameters:

  • “size_min:<long>” – minimum file size in byte.
  • “size_max:<long>” – maximum file size in byte.
  • “download_file:<bool> – boolean value, case sensitive. If set to true, the script will attempt to download a file. The ErrorCodes.Validation.FileSizeExceeds error will be returned if the file size exceeds the limit of 2097152 bytes.
  • “age:<long> – age threshold in minutes. If a file is older than specified in the parameter, an alert is generated.
  • “timezone_bias:<long>” – the time offset between monitoring agent and an FTP server in hours, can be negative. Use to calculate the “age” parameter correctly.

If the specified file is not found, an error alert is generated.

Arguments Example

Generates alerts if any files with timestamps older than 15 minutes are detected:

"sftp://localuser:password1@webclient.compass-analytics.com/doc/accounting/Export3a.csv" "size_max:4096" "age:15"

Comprehensive FTP Monitoring with Dotcom-Monitor

If access to an FTP server is a crucial element of your business processes it is important to have the FTP server available and functioning properly 24/7. For example, you may have important updates publishing directly to files on the server or your employees save files with vital information that is consumed by third-party software and must be always up-to-date. In the cases like these, it is necessary for your business to have FTP Server monitoring set up.

Although FTP is a standard of file transfer between remote computers, it cannot provide the necessary security level. Therefore, it is recommended that you use secure FTPS or SFTP protocols instead of insecure connections to your FTP servers. FTP Server Monitoring by Dotcom-Monitor supports FTP, SFTP, and FTPS protocols.

In addition to FTP Server monitoring, to have full control of your FTP server performance we recommend you to configure DNS Monitoring with the Dotcom-Monitor Monitoring solution to be aware of any issues with resolving the server DNS name. Also, it is always a good decision to set up a MetricsView monitoring device to keep tabs on memory, CPU and disk utilization, and other performance metrics of your FTP server.