Watchdog: File Size
Checks that a file's size is within an allowed range, for example to detect empty backups or runaway logs. Type file_size, runner Agent. Fields, statuses, messages.
Watchdog: File Size
The check compares a file's size in bytes with a lower and an upper limit. That lets you detect empty backup files or logs that grow out of control.
| Property | Value |
|---|---|
| Type identifier | file_size |
| Runner | Agent |
| Target in the email | Path |
Fields
| Field | Key | Default | Meaning |
|---|---|---|---|
| File path | path |
Required. Absolute path of the file | |
| Min size (bytes) | min_bytes |
0 (off) |
FAIL if the file is smaller. Use 1 to detect empty files |
| Max size (bytes) | max_bytes |
0 (off) |
FAIL if the file is larger |
Behaviour
The path is prefixed with HOST_ROOT when the variable is set in the agent.
| Situation | Status | Message |
|---|---|---|
| Size within the range | OK |
<n> bytes |
| Smaller than the lower limit | FAIL |
File is <n> bytes (min: <m> bytes) |
| Larger than the upper limit | FAIL |
File is <n> bytes (max: <m> bytes) |
| File missing | FAIL |
File not found: <path> |
| Lower limit greater than upper limit | UNKNOWN |
Invalid config: min_bytes (<a>) exceeds max_bytes (<b>) |
| Size unreadable | UNKNOWN |
Cannot read size of <path> |
| No path | UNKNOWN |
No path configured |
If both limits stay at 0, the check is OK as soon as the file exists.