How Do I Set Up System Monitor to Send Files by SFTP?
sending closeout files via SFTP
Fleetwatch FMS · System Monitor
How Do I Set Up System Monitor to Send Files by SFTP?
System Monitor can send closeout files to an SFTP server, and can run general file transfers to or from one on a schedule. You set this up with rows in the Fleetwatch database tables FTPServers and FTPTransfers.
For IT staff and Fleetwatch technicians. This means editing the Fleetwatch SQL database directly. Back up the tables first, and contact Fleetwatch Support if you aren’t sure. On Fleetwatch Cloud, Fleetwatch sets this up for you.
| To send… | Do this |
| Primary closeout | Part 1, then Part 2 with PCO |
| Secondary closeout | Part 1, then Part 2 with SCO |
| Any other file, on a schedule | Part 1, then Part 3 |
Part 1: Check the SFTP Launch Setting
In the table DataToolsSystemSettings, make sure this row exists. It’s normally created automatically. Also check that fileTransfer.php is installed in the Data Tools /system/ folder.
| Field | What to enter |
| Key | FTPLaunch |
| Value | /system/fileTransfer.php |
| ChangedBy | Your name (defaults to SystemMonitor). |
| ChangedOn | When the row was created. |
Part 2: Send Closeout Files by SFTP
| 1 | Set the closeout path. In the primary (or secondary) closeout path setting, enter the folder on the FTP server where the file should go. Leave out the server name and any drive letter. Example: to send files to \\Tahiti\MyDestination\CloseoutPath\, the server is Tahiti and the closeout path is MyDestination/CloseoutPath. |
| 2 | Add the FTP server. In the table FTPServers, add a row with DedicatedFunction set to PCO for the primary closeout or SCO for the secondary closeout (fields below). |
A folder is required. The file can’t go straight into the FTP server’s top level; there must be a folder in the closeout path. Use forward slashes (/), since most FTP servers run Linux.
| Field | What to enter |
| RecordIndex | Leave blank. Filled in automatically. |
| ServerFriendlyName | A short description, for example Primary Closeout. |
| DedicatedFunction | PCO or SCO |
| FTPServerName | The FTP server’s network name or IP address. |
| FTPUID | The FTP user name. |
| FTPPassword | The FTP password. |
| FTPPort | The FTP server’s port, usually 21. |
| CreationDate | Today’s date. |
Part 3: Set Up a General File Transfer
| 1 | Add the FTP server in FTPServers, as in Part 2. For a general transfer, leave DedicatedFunction blank or give it a descriptive name. |
| 2 | Add the transfer in the table FTPTransfers (fields below). |
Status fields (System Monitor updates these as it runs):
| Field | What to enter |
| AttemptComplete | 0 |
| OperationComplete | 0 |
| TransferSuccessful | 0 |
| Processing | 0 |
| LastAttempt | The current date and time. |
| LastResult | Leave blank. |
What to transfer:
| Field | What to enter |
| GetFile | 0 = send a file to the server. 1 = pull a file from the server. |
| TargetDirectory | The folder the file comes from. Local folder: full path, such as C:\Fleetwatch\. On the FTP server: the server path, such as /transfers/ToFleetwatch/. |
| TargetFilename | The name of the file to send or pull. |
| DestinationDirectory | The folder the file goes to, written the same way. When sending to the server, / puts it in the server’s default folder. |
| DestinationFilename | The file’s name once it arrives. |
| Append | 0 = overwrite an existing file. 1 = add to the end of it. |
| DeleteSource | 1 = delete the source file after a successful transfer. 0 = keep it. |
Server and schedule:
| Field | What to enter |
| FTPServerName | The FTP server’s name or IP address. |
| FTPPort | The port, usually 21. |
| FTPUID | The FTP user name. |
| FTPPassword | The FTP password. |
| NextAttemptTime | When the first transfer should run. |
| Recurrence | 0 = run once. Otherwise, how often to repeat, in minutes (5 = every 5 minutes). |
| RemainingAttempts | How many times to retry before giving up. -1 = keep trying. |
| CreationDate | The current date and time. |
| CreatedBy | Your name or initials. |
Paths on the FTP server use forward slashes (/transfers/ToFleetwatch/). Local Windows paths use backslashes (C:\Fleetwatch\).
Closeout files not arriving? Check the FTP server name, login and folder, then contact Fleetwatch Support.