Docs · Monitors
Files
Whether the files that should arrive have, and the ones that should leave did — the nightly export, each store's sales files, an interface's outbox — and what each reason in the Why column means.
Much of retail IT still moves in files: the nightly sales export, the price file for the morning, each store's transaction logs on their way to head office, the interface folder an ERP reads every ten minutes. When one of those stops, nothing fails loudly. The folder just stops changing.
A Files monitor looks in each folder and says whether it is changing as it should. A folder is one of two kinds, chosen under The folder is where files:
- Arrive: something writes files into it, and the newest should be recent. The nightly export, the price files, each store's sales files at head office.
- Wait to leave: something should empty it, and nothing should wait long. A store's outbox, an interface's inbox that the ERP picks up from.
| Status | Colour | Kind | Means |
|---|---|---|---|
| On time | Green | Arrive | The newest file is younger than Late after |
| Late | Red | Arrive | The newest file is older than Late after |
| No files | Red | Arrive | No file in it matches Files |
| Flowing | Green | Wait to leave | Nothing has waited longer than Stuck after, and no more than Backlog over are waiting. An empty folder is flowing |
| Backlog | Amber | Wait to leave | More files are waiting than Backlog over, none of them for too long yet |
| Stuck | Red | Wait to leave | A file has waited longer than Stuck after |
| No folder | Red | Either | The folder cannot be read. Why says why |
| No address | Grey | Either | A store with no server address |
In the answer, status is ontime, late, nofiles, flowing, backlog, stuck, missing or nohost.
A file's age is counted from when it was last written. Ages read 40 min, 27 h, 3 days 4 h.
#Before you start
- Mosaic on your own server, with the host switch on. Reading folders is a host feature: it is off on Mosaic Cloud, and off on a server until whoever runs Mosaic starts it with
MOSAIC_ACTIONS_HOST=on. The setup says so when it is off. See Commands, scripts, code and files. - The right to read the folders. Mosaic reads them as the account it runs as, from the machine it runs on. A share on another machine must let that account in. See Shares for a Files monitor.
Mosaic only reads the folder's list of files, their names, sizes and times. It never opens, moves or deletes a file.
#Setting it up
Press + beside Monitors and choose Files. Under Look at, choose a list or the stores.
| Field | Notes |
|---|---|
| Folders | For a list, one a line, on the machine Mosaic runs on or a share: \\fileserver\exports\sales, D:\interfaces\prices\in. A name before a | is shown in the table |
| Each store's folder | For the stores: \\{host}\pos\outbox. {host} is each store's server address |
| The folder is where files | Arrive or Wait to leave, as above |
| Files | Which files count: *.xml, SALES_*.csv. * stands for any run of letters, ? for one. Case does not matter. * alone is every file |
| Late after or Stuck after (minutes) | 1440, a day, to start with. 0 is never late or stuck |
| Backlog over (files) | For a folder files leave from. 0 is never a backlog |
| Count the folders inside it too | Off to start with. On, files in the folders inside it count as well |
| Check every (minutes) | 15 to start with |
Choose Late after from how often the files come, with room to spare. Files every hour: 90. One file a night at 02:00: 1500, a day and an hour, so the monitor goes red at 03:00 if a night was missed. A wait shorter than a day would turn red every day, before the next file is due.
An example list for a head office:
Nightly sales export | \\fileserver\exports\sales
Morning price file | D:\interfaces\prices\in
ERP inbox | \\erp-app01\interfaces\inboxThe first two Arrive; the third is where files Wait to leave, and belongs in a monitor of its own, since the kind is set for the whole monitor.
#The table
| Column | Field | Holds |
|---|---|---|
| Store and Code, or Name | name, code | Who |
| Folder | folder | The folder read |
| Status | status | As above |
| Files | files | How many files match |
| Newest and Newest at, or Oldest and Oldest at | newest, newestAt, oldest, oldestAt | The file judged: the newest where files arrive, the oldest where they wait to leave |
| Age (min) | ageMinutes | That file's age in minutes |
| Why | error | Empty while all is well |
| Checked | checkedAt | When it was read |
The answer holds both the newest and the oldest; add the others under Display.
#Big folders
A folder is read up to its first 100,000 entries. One that holds more is judged on those, and Why says so: Only the first 100,000 entries were looked at. An archive folder that never empties is better watched by a pattern that matches today's files only, or left out.
#What Why says
| Why | Means | What to do |
|---|---|---|
| The newest, SALES_20261121.csv, is 27 h old. | Late: nothing newer has arrived | Look at whatever writes the files: the export job, the store's sender |
| No file here matches *.xml. | Nothing matching has ever arrived, or it was all cleared away | Check Files, and that the folder is the right one |
| TX_0412.xml has waited 3 h 20 min, with 41 more behind it. | Stuck: whatever empties the folder has stopped | Look at the job or service that picks the files up |
| 250 files waiting, more than 200. | A backlog: files are leaving, slower than they come | Watch it; it turns red once the oldest waits past Stuck after |
| No such folder: \\fileserver\exports\sales. | The path does not exist | Check the path |
| The account Mosaic runs as may not read \\fileserver\exports\sales. | Access denied | Give that account read on the share and the folder: see Shares for a Files monitor |
| \\store-001\pos\outbox cannot be reached: the server or the share is not answering. | The server is down, or the share is not there | Check the store's server, or the share's name |
| D:\interfaces\prices\in is a file, not a folder. | The path names a file | Name its folder, and the file under Files |
| … is busy. | The folder is locked by something else | Usually passes by the next check |
| No address. | The store has no server address | Fill it in under Business Locations |