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:


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:

"s" "size_max:4096" "age:15"