mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-04 05:40:14 -05:00
Preliminary documentation of the log file
This commit is contained in:
parent
04732d8f49
commit
207e8acaf1
7 changed files with 705 additions and 4 deletions
16
Makefile.am
16
Makefile.am
|
|
@ -125,6 +125,7 @@ EXTRA_DIST = \
|
||||||
autogen.sh autover.sh \
|
autogen.sh autover.sh \
|
||||||
README AUTHORS HISTORY INSTALL COPYING TODO CHECK INSTALL.windows \
|
README AUTHORS HISTORY INSTALL COPYING TODO CHECK INSTALL.windows \
|
||||||
snapraid.d snapraid.1 snapraid.txt \
|
snapraid.d snapraid.1 snapraid.txt \
|
||||||
|
snapraid_log.d snapraid_log.1 snapraid_log.txt \
|
||||||
test/test-par1.conf \
|
test/test-par1.conf \
|
||||||
test/test-par2.conf \
|
test/test-par2.conf \
|
||||||
test/test-par3.conf \
|
test/test-par3.conf \
|
||||||
|
|
@ -146,7 +147,7 @@ EXTRA_DIST = \
|
||||||
raid/test/speedtest.c \
|
raid/test/speedtest.c \
|
||||||
raid/test/invtest.c
|
raid/test/invtest.c
|
||||||
|
|
||||||
man_MANS = snapraid.1
|
man_MANS = snapraid.1 snapraid_log.1
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
rm -f valgrind.log callgrind.log cachegrind.log
|
rm -f valgrind.log callgrind.log cachegrind.log
|
||||||
|
|
@ -160,6 +161,7 @@ clean-local:
|
||||||
|
|
||||||
maintainer-clean-local:
|
maintainer-clean-local:
|
||||||
rm -f snapraid.1 snapraid.txt
|
rm -f snapraid.1 snapraid.txt
|
||||||
|
rm -f snapraid_log.1 snapraid_log.txt
|
||||||
|
|
||||||
# Automatic testing
|
# Automatic testing
|
||||||
|
|
||||||
|
|
@ -1020,6 +1022,18 @@ snapraid.html : snapraid.d
|
||||||
|
|
||||||
snapraid.hh : snapraid.d
|
snapraid.hh : snapraid.d
|
||||||
advd2 frame < $(srcdir)/$< > $@
|
advd2 frame < $(srcdir)/$< > $@
|
||||||
|
|
||||||
|
snapraid_log.1 : snapraid_log.d
|
||||||
|
advd2 man < $(srcdir)/$< > $@
|
||||||
|
|
||||||
|
snapraid_log.txt : snapraid_log.d
|
||||||
|
advd2 txt < $(srcdir)/$< | todos > $@
|
||||||
|
|
||||||
|
snapraid_log.html : snapraid_log.d
|
||||||
|
advd2 html < $(srcdir)/$< > $@
|
||||||
|
|
||||||
|
snapraid_log.hh : snapraid_log.d
|
||||||
|
advd2 frame < $(srcdir)/$< > $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Windows distribution
|
# Windows distribution
|
||||||
|
|
|
||||||
|
|
@ -1217,6 +1217,7 @@ the \'%\' character, e.g., result\-%%D.log. To use \'>>\', you must
|
||||||
enclose the name in quotes, e.g., \[dq]>>result.log\[dq].
|
enclose the name in quotes, e.g., \[dq]>>result.log\[dq].
|
||||||
To output the log to standard output or standard error,
|
To output the log to standard output or standard error,
|
||||||
you can use \[dq]>&1\[dq] and \[dq]>&2\[dq], respectively.
|
you can use \[dq]>&1\[dq] and \[dq]>&2\[dq], respectively.
|
||||||
|
See the snapraid_log.txt file or man page for log tag descriptions.
|
||||||
.TP
|
.TP
|
||||||
.B \-L, \-\-error\-limit NUMBER
|
.B \-L, \-\-error\-limit NUMBER
|
||||||
Sets a new error limit before stopping execution.
|
Sets a new error limit before stopping execution.
|
||||||
|
|
@ -1884,4 +1885,4 @@ in UTF\-8 format.
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
This file is Copyright (C) 2025 Andrea Mazzoleni
|
This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
rsync(1)
|
snapraid_log(1), rsync(1)
|
||||||
|
|
|
||||||
|
|
@ -939,6 +939,7 @@ Options
|
||||||
enclose the name in quotes, e.g., ">>result.log".
|
enclose the name in quotes, e.g., ">>result.log".
|
||||||
To output the log to standard output or standard error,
|
To output the log to standard output or standard error,
|
||||||
you can use ">&1" and ">&2", respectively.
|
you can use ">&1" and ">&2", respectively.
|
||||||
|
See the snapraid_log.txt file or man page for log tag descriptions.
|
||||||
|
|
||||||
-L, --error-limit NUMBER
|
-L, --error-limit NUMBER
|
||||||
Sets a new error limit before stopping execution.
|
Sets a new error limit before stopping execution.
|
||||||
|
|
@ -1449,4 +1450,4 @@ Copyright
|
||||||
This file is Copyright (C) 2025 Andrea Mazzoleni
|
This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
rsync(1)
|
snapraid_log(1), rsync(1)
|
||||||
|
|
|
||||||
|
|
@ -998,6 +998,7 @@ SnapRAID provides the following options:
|
||||||
enclose the name in quotes, e.g., ">>result.log".
|
enclose the name in quotes, e.g., ">>result.log".
|
||||||
To output the log to standard output or standard error,
|
To output the log to standard output or standard error,
|
||||||
you can use ">&1" and ">&2", respectively.
|
you can use ">&1" and ">&2", respectively.
|
||||||
|
See the snapraid_log.txt file or man page for log tag descriptions.
|
||||||
|
|
||||||
-L, --error-limit NUMBER
|
-L, --error-limit NUMBER
|
||||||
Sets a new error limit before stopping execution.
|
Sets a new error limit before stopping execution.
|
||||||
|
|
@ -1563,4 +1564,4 @@ This file is Copyright (C) 2025 Andrea Mazzoleni
|
||||||
13 SEE ALSO
|
13 SEE ALSO
|
||||||
===========
|
===========
|
||||||
|
|
||||||
rsync(1)
|
snapraid_log(1), rsync(1)
|
||||||
|
|
|
||||||
283
snapraid_log.1
Normal file
283
snapraid_log.1
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
.TH "SnapRAID Log Format" 1
|
||||||
|
.SH NAME
|
||||||
|
snapraid_log \- SnapRAID Log Format
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This document describes the structured log tags output by SnapRAID,
|
||||||
|
which are designed to be used by tools monitoring the SnapRAID
|
||||||
|
processing state. The tags provide information in an easy\-to\-parse
|
||||||
|
format, ideal for automation and integration.
|
||||||
|
.PP
|
||||||
|
To capture these structured log tags, you must use the \`\-\-log\` option
|
||||||
|
with SnapRAID.
|
||||||
|
.PP
|
||||||
|
You can direct the output to a specific file, or force the output to
|
||||||
|
the standard output or standard error using the special arguments
|
||||||
|
\`>&1\` or \`>&2\`. Note that these arguments often need to be quoted on
|
||||||
|
the command line to prevent the shell from interpreting them.
|
||||||
|
.PP
|
||||||
|
Example:
|
||||||
|
.PP
|
||||||
|
.RS 4
|
||||||
|
snapraid status \-\-log \[dq]>&2\[dq]
|
||||||
|
.PD 0
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
|
The output tags strictly adhere to the following format:
|
||||||
|
.PP
|
||||||
|
NAME:VALUE:VALUE:VALUE...<EOL>
|
||||||
|
.PD 0
|
||||||
|
.PD
|
||||||
|
.TP
|
||||||
|
.B NAME
|
||||||
|
This is the primary tag identifier, always a lowercase string
|
||||||
|
without spaces (e.g., \`summary\`, \`block\`, \`info_time\`).
|
||||||
|
.TP
|
||||||
|
.B VALUE
|
||||||
|
Following the \`NAME\`, these can be additional sub\-identifiers,
|
||||||
|
descriptive names (like a disk name), or numeric/string data
|
||||||
|
values. They are separated by a colon \`:\`.
|
||||||
|
.TP
|
||||||
|
.B <EOL>
|
||||||
|
Each tag is terminated by an end\-of\-line character.
|
||||||
|
.PP
|
||||||
|
This document provides a summary of the tags generated by SnapRAID.
|
||||||
|
For the most detailed and up\-to\-date information regarding the meaning
|
||||||
|
and context of the values, it is recommended to check the source
|
||||||
|
code\'s \`log_tag()\` statements.
|
||||||
|
.SH STATUS
|
||||||
|
This section describe the tags output with the \`status\` command.
|
||||||
|
.PP
|
||||||
|
All tags start with a prefix indicating the context, typically \`summary:\`
|
||||||
|
for overall statistics or a disk/block context.
|
||||||
|
.SS General Summary Tags
|
||||||
|
These tags provide general information about the array configuration and overall state.
|
||||||
|
.TP
|
||||||
|
.B summary:block_size:<uint>
|
||||||
|
The size of a block in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:parity_block_count:<uint>
|
||||||
|
The total number of blocks allocated for all parity levels.
|
||||||
|
.TP
|
||||||
|
.B summary:parity_block_total:<name>:<uint>
|
||||||
|
Total blocks available for a specific parity level.
|
||||||
|
.TP
|
||||||
|
.B summary:parity_block_free:<name>:<uint>
|
||||||
|
Free blocks available for a specific parity level.
|
||||||
|
.TP
|
||||||
|
.B summary:parity_block_free_min:<uint>
|
||||||
|
The minimum number of free blocks across all parity levels.
|
||||||
|
.TP
|
||||||
|
.B summary:file_count:<uint>
|
||||||
|
Total number of files in the array.
|
||||||
|
.TP
|
||||||
|
.B summary:file_block_count:<uint64>
|
||||||
|
Total number of data blocks used by files.
|
||||||
|
.TP
|
||||||
|
.B summary:fragmented_file_count:<uint>
|
||||||
|
Total number of fragmented files.
|
||||||
|
.TP
|
||||||
|
.B summary:excess_fragment_count:<uint>
|
||||||
|
Total number of excess fragments (one less than the total fragments).
|
||||||
|
.TP
|
||||||
|
.B summary:zerosubsecond_file_count:<uint>
|
||||||
|
Total number of files with a zero sub\-second timestamp.
|
||||||
|
.TP
|
||||||
|
.B summary:file_size:<uint64>
|
||||||
|
Total size of all files in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:parity_size:<uint64>
|
||||||
|
Total size of allocated parity blocks in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:parity_size_max:<uint64>
|
||||||
|
Maximum possible parity size (allocated + min free) in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:hash:<name>
|
||||||
|
The current hash algorithm in use.
|
||||||
|
.TP
|
||||||
|
.B summary:prev_hash:<name>
|
||||||
|
The previous hash algorithm used.
|
||||||
|
.TP
|
||||||
|
.B summary:best_hash:<name>
|
||||||
|
The best hash algorithm for optimal performance.
|
||||||
|
.TP
|
||||||
|
.B summary:total_wasted:<uint64>
|
||||||
|
Total wasted space (space on data disks exceeding parity capacity) in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:total_used:<uint64>
|
||||||
|
Total used space by data files in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:total_free:<uint64>
|
||||||
|
Total free space (usable by data) in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:total_use_percent:<uint>
|
||||||
|
Overall array use percentage.
|
||||||
|
.TP
|
||||||
|
.B summary:has_unsynced:<uint>
|
||||||
|
Count of blocks that are unsynced (need a sync).
|
||||||
|
.TP
|
||||||
|
.B summary:has_unscrubbed:<uint>
|
||||||
|
Count of blocks that are unscrubbed (just synced).
|
||||||
|
.TP
|
||||||
|
.B summary:has_rehash:<uint>
|
||||||
|
Count of blocks needing a rehash.
|
||||||
|
.TP
|
||||||
|
.B summary:has_bad:<count>:<first>:<last>
|
||||||
|
Count of bad blocks, along with the first and last bad block index.
|
||||||
|
.TP
|
||||||
|
.B summary:scrub_oldest_days:<uint>
|
||||||
|
Days ago the oldest block was last scrubbed.
|
||||||
|
.TP
|
||||||
|
.B summary:scrub_median_days:<uint>
|
||||||
|
Days ago the median block was last scrubbed.
|
||||||
|
.TP
|
||||||
|
.B summary:scrub_newest_days:<uint>
|
||||||
|
Days ago the newest block was last scrubbed.
|
||||||
|
.SS Per\-Disk Tags
|
||||||
|
These tags provide statistics for individual data disks. \`<name>\`
|
||||||
|
is the disk name.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_file_count:<name>:<uint>
|
||||||
|
Number of files on the disk.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_block_count:<name>:<uint>
|
||||||
|
Number of blocks used by files on the disk.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_fragmented_file_count:<name>:<uint>
|
||||||
|
Number of fragmented files on the disk.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_excess_fragment_count:<name>:<uint>
|
||||||
|
Number of excess fragments on the disk.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_zerosubsecond_file_count:<name>:<uint>
|
||||||
|
Number of files with zero sub\-second timestamp on the disk.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_file_size:<name>:<uint64>
|
||||||
|
Total size of files on the disk in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_block_allocated:<name>:<uint>
|
||||||
|
Highest block index used on the disk + 1.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_block_total:<name>:<uint>
|
||||||
|
Total blocks on the disk (physical size).
|
||||||
|
.TP
|
||||||
|
.B summary:disk_block_free:<name>:<uint>
|
||||||
|
Free blocks on the disk.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_block_max_by_space:<name>:<uint>
|
||||||
|
Total blocks by disk space (used + free blocks).
|
||||||
|
.TP
|
||||||
|
.B summary:disk_block_max_by_parity:<name>:<uint>
|
||||||
|
Total blocks limited by parity space (parity size + min parity free blocks).
|
||||||
|
.TP
|
||||||
|
.B summary:disk_block_max:<name>:<uint>
|
||||||
|
Maximum usable blocks (minimum of \`..._by_space\` and \`..._by_parity\`).
|
||||||
|
.TP
|
||||||
|
.B summary:disk_space_wasted:<name>:<int64>
|
||||||
|
Wasted space on the disk in bytes (positive if disk is larger than usable parity space).
|
||||||
|
.TP
|
||||||
|
.B summary:disk_used:<name>:<uint64>
|
||||||
|
Used space on the disk in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_free:<name>:<uint64>
|
||||||
|
Free usable space on the disk in bytes.
|
||||||
|
.TP
|
||||||
|
.B summary:disk_use_percent:<name>:<uint>
|
||||||
|
Disk use percentage relative to \`disk_block_max\`.
|
||||||
|
.SS File Timestamp Tags
|
||||||
|
These tags list files with zero sub\-second timestamps.
|
||||||
|
.TP
|
||||||
|
.B zerosubsecond:<disk_name>:<file_path>
|
||||||
|
Lists files that have a zero sub\-second timestamp.
|
||||||
|
Up to 50 are logged per disk.
|
||||||
|
.SS Block Information Tags
|
||||||
|
These tags are generated when the GUI option is enabled (\`state\->opt.gui\`).
|
||||||
|
.TP
|
||||||
|
.B block_count:<uint>
|
||||||
|
The total number of blocks in the array.
|
||||||
|
.TP
|
||||||
|
.B block:<index>:<time>:<used>:<unsynced>:<bad>:<rehash>
|
||||||
|
Status of a specific block.
|
||||||
|
.RS 4
|
||||||
|
.PD 0
|
||||||
|
.HP 4
|
||||||
|
.I <index>
|
||||||
|
Block index.
|
||||||
|
.HP 4
|
||||||
|
.I <time>
|
||||||
|
Last scrub time (Unix timestamp).
|
||||||
|
.HP 4
|
||||||
|
.I <used>
|
||||||
|
\[dq]used\[dq] if the block contains data.
|
||||||
|
.HP 4
|
||||||
|
.I <unsynced>
|
||||||
|
\[dq]unsynced\[dq] if the block needs a sync.
|
||||||
|
.HP 4
|
||||||
|
.I <bad>
|
||||||
|
\[dq]bad\[dq] if the block has errors.
|
||||||
|
.HP 4
|
||||||
|
.I <rehash>
|
||||||
|
\[dq]rehash\[dq] if the block needs a rehash.
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
|
.B block_noinfo:<index>:<used>:<unsynced>
|
||||||
|
Status of an unused block (no info recorded).
|
||||||
|
.SS Scrub History Tags
|
||||||
|
These tags provide details on the scrub/sync time distribution.
|
||||||
|
.TP
|
||||||
|
.B info_count:<uint>
|
||||||
|
Total number of info recorded about past scrub and sync
|
||||||
|
operations.
|
||||||
|
.TP
|
||||||
|
.B info_time:<time>:<count>:<status>
|
||||||
|
All the info records.
|
||||||
|
.RS 4
|
||||||
|
.PD 0
|
||||||
|
.HP 4
|
||||||
|
.I <time>
|
||||||
|
Unix timestamp of the scrub/sync.
|
||||||
|
.HP 4
|
||||||
|
.I <count>
|
||||||
|
Number of blocks processed at this timestamp.
|
||||||
|
.HP 4
|
||||||
|
.I <status>
|
||||||
|
\[dq]scrubbed\[dq] or \[dq]new\[dq] (for synced blocks).
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
|
.B scrub_graph_range:<max_columns>:<max_height>
|
||||||
|
Dimensions of the scrub history graph obtained from the
|
||||||
|
\`info_time\` records. This provides the boundary for the
|
||||||
|
precomputed graph data available in the \`scrub_graph_bar\` tags.
|
||||||
|
.RS 4
|
||||||
|
.PD 0
|
||||||
|
.HP 4
|
||||||
|
.I <max_columns>
|
||||||
|
The number of columns in the graph (constant
|
||||||
|
GRAPH_COLUMN).
|
||||||
|
.HP 4
|
||||||
|
.I <max_height>
|
||||||
|
The maximum height (peak count) of blocks found
|
||||||
|
in any column (the highest sum of scrubbed and new blocks).
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
|
.B scrub_graph_bar:<index>:<days_ago>:<scrubbed>:<new>
|
||||||
|
Data for a column of the scrub history graph.
|
||||||
|
.RS 4
|
||||||
|
.PD 0
|
||||||
|
.HP 4
|
||||||
|
.I <index>
|
||||||
|
Column index. From 0 to max_columns \- 1.
|
||||||
|
.HP 4
|
||||||
|
.I <days_ago>
|
||||||
|
Days ago for this column\'s time range.
|
||||||
|
.HP 4
|
||||||
|
.I <scrubbed>
|
||||||
|
Count of scrubbed blocks in that day.
|
||||||
|
.HP 4
|
||||||
|
.I <new>
|
||||||
|
Count of newly synced (unscrubbed) blocks in that day.
|
||||||
|
.PD
|
||||||
|
.RE
|
||||||
197
snapraid_log.d
Normal file
197
snapraid_log.d
Normal file
|
|
@ -0,0 +1,197 @@
|
||||||
|
Name{number}
|
||||||
|
snapraid_log - SnapRAID Log Format
|
||||||
|
|
||||||
|
Description
|
||||||
|
This document describes the structured log tags output by SnapRAID,
|
||||||
|
which are designed to be used by tools monitoring the SnapRAID
|
||||||
|
processing state. The tags provide information in an easy-to-parse
|
||||||
|
format, ideal for automation and integration.
|
||||||
|
|
||||||
|
To capture these structured log tags, you must use the `--log` option
|
||||||
|
with SnapRAID.
|
||||||
|
|
||||||
|
You can direct the output to a specific file, or force the output to
|
||||||
|
the standard output or standard error using the special arguments
|
||||||
|
`>&1` or `>&2`. Note that these arguments often need to be quoted on
|
||||||
|
the command line to prevent the shell from interpreting them.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
:snapraid status --log ">&2"
|
||||||
|
|
||||||
|
The output tags strictly adhere to the following format:
|
||||||
|
|
||||||
|
:NAME:VALUE:VALUE:VALUE...<EOL>
|
||||||
|
|
||||||
|
=NAME
|
||||||
|
This is the primary tag identifier, always a lowercase string
|
||||||
|
without spaces (e.g., `summary`, `block`, `info_time`).
|
||||||
|
=VALUE
|
||||||
|
Following the `NAME`, these can be additional sub-identifiers,
|
||||||
|
descriptive names (like a disk name), or numeric/string data
|
||||||
|
values. They are separated by a colon `:`.
|
||||||
|
=<EOL>
|
||||||
|
Each tag is terminated by an end-of-line character.
|
||||||
|
|
||||||
|
This document provides a summary of the tags generated by SnapRAID.
|
||||||
|
For the most detailed and up-to-date information regarding the meaning
|
||||||
|
and context of the values, it is recommended to check the source
|
||||||
|
code's `log_tag()` statements.
|
||||||
|
|
||||||
|
Status
|
||||||
|
This section describe the tags output with the `status` command.
|
||||||
|
|
||||||
|
All tags start with a prefix indicating the context, typically `summary:`
|
||||||
|
for overall statistics or a disk/block context.
|
||||||
|
|
||||||
|
General Summary Tags
|
||||||
|
These tags provide general information about the array configuration and overall state.
|
||||||
|
|
||||||
|
=summary:block_size:<uint>
|
||||||
|
The size of a block in bytes.
|
||||||
|
=summary:parity_block_count:<uint>
|
||||||
|
The total number of blocks allocated for all parity levels.
|
||||||
|
=summary:parity_block_total:<name>:<uint>
|
||||||
|
Total blocks available for a specific parity level.
|
||||||
|
=summary:parity_block_free:<name>:<uint>
|
||||||
|
Free blocks available for a specific parity level.
|
||||||
|
=summary:parity_block_free_min:<uint>
|
||||||
|
The minimum number of free blocks across all parity levels.
|
||||||
|
=summary:file_count:<uint>
|
||||||
|
Total number of files in the array.
|
||||||
|
=summary:file_block_count:<uint64>
|
||||||
|
Total number of data blocks used by files.
|
||||||
|
=summary:fragmented_file_count:<uint>
|
||||||
|
Total number of fragmented files.
|
||||||
|
=summary:excess_fragment_count:<uint>
|
||||||
|
Total number of excess fragments (one less than the total fragments).
|
||||||
|
=summary:zerosubsecond_file_count:<uint>
|
||||||
|
Total number of files with a zero sub-second timestamp.
|
||||||
|
=summary:file_size:<uint64>
|
||||||
|
Total size of all files in bytes.
|
||||||
|
=summary:parity_size:<uint64>
|
||||||
|
Total size of allocated parity blocks in bytes.
|
||||||
|
=summary:parity_size_max:<uint64>
|
||||||
|
Maximum possible parity size (allocated + min free) in bytes.
|
||||||
|
=summary:hash:<name>
|
||||||
|
The current hash algorithm in use.
|
||||||
|
=summary:prev_hash:<name>
|
||||||
|
The previous hash algorithm used.
|
||||||
|
=summary:best_hash:<name>
|
||||||
|
The best hash algorithm for optimal performance.
|
||||||
|
=summary:total_wasted:<uint64>
|
||||||
|
Total wasted space (space on data disks exceeding parity capacity) in bytes.
|
||||||
|
=summary:total_used:<uint64>
|
||||||
|
Total used space by data files in bytes.
|
||||||
|
=summary:total_free:<uint64>
|
||||||
|
Total free space (usable by data) in bytes.
|
||||||
|
=summary:total_use_percent:<uint>
|
||||||
|
Overall array use percentage.
|
||||||
|
=summary:has_unsynced:<uint>
|
||||||
|
Count of blocks that are unsynced (need a sync).
|
||||||
|
=summary:has_unscrubbed:<uint>
|
||||||
|
Count of blocks that are unscrubbed (just synced).
|
||||||
|
=summary:has_rehash:<uint>
|
||||||
|
Count of blocks needing a rehash.
|
||||||
|
=summary:has_bad:<count>:<first>:<last>
|
||||||
|
Count of bad blocks, along with the first and last bad block index.
|
||||||
|
=summary:scrub_oldest_days:<uint>
|
||||||
|
Days ago the oldest block was last scrubbed.
|
||||||
|
=summary:scrub_median_days:<uint>
|
||||||
|
Days ago the median block was last scrubbed.
|
||||||
|
=summary:scrub_newest_days:<uint>
|
||||||
|
Days ago the newest block was last scrubbed.
|
||||||
|
|
||||||
|
Per-Disk Tags
|
||||||
|
These tags provide statistics for individual data disks. `<name>`
|
||||||
|
is the disk name.
|
||||||
|
|
||||||
|
=summary:disk_file_count:<name>:<uint>
|
||||||
|
Number of files on the disk.
|
||||||
|
=summary:disk_block_count:<name>:<uint>
|
||||||
|
Number of blocks used by files on the disk.
|
||||||
|
=summary:disk_fragmented_file_count:<name>:<uint>
|
||||||
|
Number of fragmented files on the disk.
|
||||||
|
=summary:disk_excess_fragment_count:<name>:<uint>
|
||||||
|
Number of excess fragments on the disk.
|
||||||
|
=summary:disk_zerosubsecond_file_count:<name>:<uint>
|
||||||
|
Number of files with zero sub-second timestamp on the disk.
|
||||||
|
=summary:disk_file_size:<name>:<uint64>
|
||||||
|
Total size of files on the disk in bytes.
|
||||||
|
=summary:disk_block_allocated:<name>:<uint>
|
||||||
|
Highest block index used on the disk + 1.
|
||||||
|
=summary:disk_block_total:<name>:<uint>
|
||||||
|
Total blocks on the disk (physical size).
|
||||||
|
=summary:disk_block_free:<name>:<uint>
|
||||||
|
Free blocks on the disk.
|
||||||
|
=summary:disk_block_max_by_space:<name>:<uint>
|
||||||
|
Total blocks by disk space (used + free blocks).
|
||||||
|
=summary:disk_block_max_by_parity:<name>:<uint>
|
||||||
|
Total blocks limited by parity space (parity size + min parity free blocks).
|
||||||
|
=summary:disk_block_max:<name>:<uint>
|
||||||
|
Maximum usable blocks (minimum of `..._by_space` and `..._by_parity`).
|
||||||
|
=summary:disk_space_wasted:<name>:<int64>
|
||||||
|
Wasted space on the disk in bytes (positive if disk is larger than usable parity space).
|
||||||
|
=summary:disk_used:<name>:<uint64>
|
||||||
|
Used space on the disk in bytes.
|
||||||
|
=summary:disk_free:<name>:<uint64>
|
||||||
|
Free usable space on the disk in bytes.
|
||||||
|
=summary:disk_use_percent:<name>:<uint>
|
||||||
|
Disk use percentage relative to `disk_block_max`.
|
||||||
|
|
||||||
|
File Timestamp Tags
|
||||||
|
These tags list files with zero sub-second timestamps.
|
||||||
|
|
||||||
|
=zerosubsecond:<disk_name>:<file_path>
|
||||||
|
Lists files that have a zero sub-second timestamp.
|
||||||
|
Up to 50 are logged per disk.
|
||||||
|
|
||||||
|
Block Information Tags
|
||||||
|
These tags are generated when the GUI option is enabled (`state->opt.gui`).
|
||||||
|
|
||||||
|
=block_count:<uint>
|
||||||
|
The total number of blocks in the array.
|
||||||
|
=block:<index>:<time>:<used>:<unsynced>:<bad>:<rehash>
|
||||||
|
Status of a specific block.
|
||||||
|
|
||||||
|
<index> - Block index.
|
||||||
|
<time> - Last scrub time (Unix timestamp).
|
||||||
|
<used> - "used" if the block contains data.
|
||||||
|
<unsynced> - "unsynced" if the block needs a sync.
|
||||||
|
<bad> - "bad" if the block has errors.
|
||||||
|
<rehash> - "rehash" if the block needs a rehash.
|
||||||
|
|
||||||
|
=block_noinfo:<index>:<used>:<unsynced>
|
||||||
|
Status of an unused block (no info recorded).
|
||||||
|
|
||||||
|
Scrub History Tags
|
||||||
|
These tags provide details on the scrub/sync time distribution.
|
||||||
|
|
||||||
|
=info_count:<uint>
|
||||||
|
Total number of info recorded about past scrub and sync
|
||||||
|
operations.
|
||||||
|
|
||||||
|
=info_time:<time>:<count>:<status>
|
||||||
|
All the info records.
|
||||||
|
|
||||||
|
<time> - Unix timestamp of the scrub/sync.
|
||||||
|
<count> - Number of blocks processed at this timestamp.
|
||||||
|
<status> - "scrubbed" or "new" (for synced blocks).
|
||||||
|
|
||||||
|
=scrub_graph_range:<max_columns>:<max_height>
|
||||||
|
Dimensions of the scrub history graph obtained from the
|
||||||
|
`info_time` records. This provides the boundary for the
|
||||||
|
precomputed graph data available in the `scrub_graph_bar` tags.
|
||||||
|
|
||||||
|
<max_columns> - The number of columns in the graph (constant
|
||||||
|
GRAPH_COLUMN).
|
||||||
|
<max_height> - The maximum height (peak count) of blocks found
|
||||||
|
in any column (the highest sum of scrubbed and new blocks).
|
||||||
|
|
||||||
|
=scrub_graph_bar:<index>:<days_ago>:<scrubbed>:<new>
|
||||||
|
Data for a column of the scrub history graph.
|
||||||
|
|
||||||
|
<index> - Column index. From 0 to max_columns - 1.
|
||||||
|
<days_ago> - Days ago for this column's time range.
|
||||||
|
<scrubbed> - Count of scrubbed blocks in that day.
|
||||||
|
<new> - Count of newly synced (unscrubbed) blocks in that day.
|
||||||
204
snapraid_log.txt
Normal file
204
snapraid_log.txt
Normal file
|
|
@ -0,0 +1,204 @@
|
||||||
|
===================
|
||||||
|
SnapRAID Log Format
|
||||||
|
===================
|
||||||
|
|
||||||
|
|
||||||
|
1 DESCRIPTION
|
||||||
|
=============
|
||||||
|
|
||||||
|
This document describes the structured log tags output by SnapRAID,
|
||||||
|
which are designed to be used by tools monitoring the SnapRAID
|
||||||
|
processing state. The tags provide information in an easy-to-parse
|
||||||
|
format, ideal for automation and integration.
|
||||||
|
|
||||||
|
To capture these structured log tags, you must use the `--log` option
|
||||||
|
with SnapRAID.
|
||||||
|
|
||||||
|
You can direct the output to a specific file, or force the output to
|
||||||
|
the standard output or standard error using the special arguments
|
||||||
|
`>&1` or `>&2`. Note that these arguments often need to be quoted on
|
||||||
|
the command line to prevent the shell from interpreting them.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
snapraid status --log ">&2"
|
||||||
|
|
||||||
|
The output tags strictly adhere to the following format:
|
||||||
|
|
||||||
|
NAME:VALUE:VALUE:VALUE...<EOL>
|
||||||
|
|
||||||
|
NAME
|
||||||
|
This is the primary tag identifier, always a lowercase string
|
||||||
|
without spaces (e.g., `summary`, `block`, `info_time`).
|
||||||
|
VALUE
|
||||||
|
Following the `NAME`, these can be additional sub-identifiers,
|
||||||
|
descriptive names (like a disk name), or numeric/string data
|
||||||
|
values. They are separated by a colon `:`.
|
||||||
|
<EOL>
|
||||||
|
Each tag is terminated by an end-of-line character.
|
||||||
|
|
||||||
|
This document provides a summary of the tags generated by SnapRAID.
|
||||||
|
For the most detailed and up-to-date information regarding the meaning
|
||||||
|
and context of the values, it is recommended to check the source
|
||||||
|
code's `log_tag()` statements.
|
||||||
|
|
||||||
|
|
||||||
|
2 STATUS
|
||||||
|
========
|
||||||
|
|
||||||
|
This section describe the tags output with the `status` command.
|
||||||
|
|
||||||
|
All tags start with a prefix indicating the context, typically `summary:`
|
||||||
|
for overall statistics or a disk/block context.
|
||||||
|
|
||||||
|
---- 2.0.1 General Summary Tags ----
|
||||||
|
These tags provide general information about the array configuration and overall state.
|
||||||
|
|
||||||
|
summary:block_size:<uint>
|
||||||
|
The size of a block in bytes.
|
||||||
|
summary:parity_block_count:<uint>
|
||||||
|
The total number of blocks allocated for all parity levels.
|
||||||
|
summary:parity_block_total:<name>:<uint>
|
||||||
|
Total blocks available for a specific parity level.
|
||||||
|
summary:parity_block_free:<name>:<uint>
|
||||||
|
Free blocks available for a specific parity level.
|
||||||
|
summary:parity_block_free_min:<uint>
|
||||||
|
The minimum number of free blocks across all parity levels.
|
||||||
|
summary:file_count:<uint>
|
||||||
|
Total number of files in the array.
|
||||||
|
summary:file_block_count:<uint64>
|
||||||
|
Total number of data blocks used by files.
|
||||||
|
summary:fragmented_file_count:<uint>
|
||||||
|
Total number of fragmented files.
|
||||||
|
summary:excess_fragment_count:<uint>
|
||||||
|
Total number of excess fragments (one less than the total fragments).
|
||||||
|
summary:zerosubsecond_file_count:<uint>
|
||||||
|
Total number of files with a zero sub-second timestamp.
|
||||||
|
summary:file_size:<uint64>
|
||||||
|
Total size of all files in bytes.
|
||||||
|
summary:parity_size:<uint64>
|
||||||
|
Total size of allocated parity blocks in bytes.
|
||||||
|
summary:parity_size_max:<uint64>
|
||||||
|
Maximum possible parity size (allocated + min free) in bytes.
|
||||||
|
summary:hash:<name>
|
||||||
|
The current hash algorithm in use.
|
||||||
|
summary:prev_hash:<name>
|
||||||
|
The previous hash algorithm used.
|
||||||
|
summary:best_hash:<name>
|
||||||
|
The best hash algorithm for optimal performance.
|
||||||
|
summary:total_wasted:<uint64>
|
||||||
|
Total wasted space (space on data disks exceeding parity capacity) in bytes.
|
||||||
|
summary:total_used:<uint64>
|
||||||
|
Total used space by data files in bytes.
|
||||||
|
summary:total_free:<uint64>
|
||||||
|
Total free space (usable by data) in bytes.
|
||||||
|
summary:total_use_percent:<uint>
|
||||||
|
Overall array use percentage.
|
||||||
|
summary:has_unsynced:<uint>
|
||||||
|
Count of blocks that are unsynced (need a sync).
|
||||||
|
summary:has_unscrubbed:<uint>
|
||||||
|
Count of blocks that are unscrubbed (just synced).
|
||||||
|
summary:has_rehash:<uint>
|
||||||
|
Count of blocks needing a rehash.
|
||||||
|
summary:has_bad:<count>:<first>:<last>
|
||||||
|
Count of bad blocks, along with the first and last bad block index.
|
||||||
|
summary:scrub_oldest_days:<uint>
|
||||||
|
Days ago the oldest block was last scrubbed.
|
||||||
|
summary:scrub_median_days:<uint>
|
||||||
|
Days ago the median block was last scrubbed.
|
||||||
|
summary:scrub_newest_days:<uint>
|
||||||
|
Days ago the newest block was last scrubbed.
|
||||||
|
|
||||||
|
---- 2.0.2 Per-Disk Tags ----
|
||||||
|
These tags provide statistics for individual data disks. `<name>`
|
||||||
|
is the disk name.
|
||||||
|
|
||||||
|
summary:disk_file_count:<name>:<uint>
|
||||||
|
Number of files on the disk.
|
||||||
|
summary:disk_block_count:<name>:<uint>
|
||||||
|
Number of blocks used by files on the disk.
|
||||||
|
summary:disk_fragmented_file_count:<name>:<uint>
|
||||||
|
Number of fragmented files on the disk.
|
||||||
|
summary:disk_excess_fragment_count:<name>:<uint>
|
||||||
|
Number of excess fragments on the disk.
|
||||||
|
summary:disk_zerosubsecond_file_count:<name>:<uint>
|
||||||
|
Number of files with zero sub-second timestamp on the disk.
|
||||||
|
summary:disk_file_size:<name>:<uint64>
|
||||||
|
Total size of files on the disk in bytes.
|
||||||
|
summary:disk_block_allocated:<name>:<uint>
|
||||||
|
Highest block index used on the disk + 1.
|
||||||
|
summary:disk_block_total:<name>:<uint>
|
||||||
|
Total blocks on the disk (physical size).
|
||||||
|
summary:disk_block_free:<name>:<uint>
|
||||||
|
Free blocks on the disk.
|
||||||
|
summary:disk_block_max_by_space:<name>:<uint>
|
||||||
|
Total blocks by disk space (used + free blocks).
|
||||||
|
summary:disk_block_max_by_parity:<name>:<uint>
|
||||||
|
Total blocks limited by parity space (parity size + min parity free blocks).
|
||||||
|
summary:disk_block_max:<name>:<uint>
|
||||||
|
Maximum usable blocks (minimum of `..._by_space` and `..._by_parity`).
|
||||||
|
summary:disk_space_wasted:<name>:<int64>
|
||||||
|
Wasted space on the disk in bytes (positive if disk is larger than usable parity space).
|
||||||
|
summary:disk_used:<name>:<uint64>
|
||||||
|
Used space on the disk in bytes.
|
||||||
|
summary:disk_free:<name>:<uint64>
|
||||||
|
Free usable space on the disk in bytes.
|
||||||
|
summary:disk_use_percent:<name>:<uint>
|
||||||
|
Disk use percentage relative to `disk_block_max`.
|
||||||
|
|
||||||
|
---- 2.0.3 File Timestamp Tags ----
|
||||||
|
These tags list files with zero sub-second timestamps.
|
||||||
|
|
||||||
|
zerosubsecond:<disk_name>:<file_path>
|
||||||
|
Lists files that have a zero sub-second timestamp.
|
||||||
|
Up to 50 are logged per disk.
|
||||||
|
|
||||||
|
---- 2.0.4 Block Information Tags ----
|
||||||
|
These tags are generated when the GUI option is enabled (`state->opt.gui`).
|
||||||
|
|
||||||
|
block_count:<uint>
|
||||||
|
The total number of blocks in the array.
|
||||||
|
block:<index>:<time>:<used>:<unsynced>:<bad>:<rehash>
|
||||||
|
Status of a specific block.
|
||||||
|
|
||||||
|
<index> - Block index.
|
||||||
|
<time> - Last scrub time (Unix timestamp).
|
||||||
|
<used> - "used" if the block contains data.
|
||||||
|
<unsynced> - "unsynced" if the block needs a sync.
|
||||||
|
<bad> - "bad" if the block has errors.
|
||||||
|
<rehash> - "rehash" if the block needs a rehash.
|
||||||
|
|
||||||
|
block_noinfo:<index>:<used>:<unsynced>
|
||||||
|
Status of an unused block (no info recorded).
|
||||||
|
|
||||||
|
---- 2.0.5 Scrub History Tags ----
|
||||||
|
These tags provide details on the scrub/sync time distribution.
|
||||||
|
|
||||||
|
info_count:<uint>
|
||||||
|
Total number of info recorded about past scrub and sync
|
||||||
|
operations.
|
||||||
|
|
||||||
|
info_time:<time>:<count>:<status>
|
||||||
|
All the info records.
|
||||||
|
|
||||||
|
<time> - Unix timestamp of the scrub/sync.
|
||||||
|
<count> - Number of blocks processed at this timestamp.
|
||||||
|
<status> - "scrubbed" or "new" (for synced blocks).
|
||||||
|
|
||||||
|
scrub_graph_range:<max_columns>:<max_height>
|
||||||
|
Dimensions of the scrub history graph obtained from the
|
||||||
|
`info_time` records. This provides the boundary for the
|
||||||
|
precomputed graph data available in the `scrub_graph_bar` tags.
|
||||||
|
|
||||||
|
<max_columns> - The number of columns in the graph (constant
|
||||||
|
GRAPH_COLUMN).
|
||||||
|
<max_height> - The maximum height (peak count) of blocks found
|
||||||
|
in any column (the highest sum of scrubbed and new blocks).
|
||||||
|
|
||||||
|
scrub_graph_bar:<index>:<days_ago>:<scrubbed>:<new>
|
||||||
|
Data for a column of the scrub history graph.
|
||||||
|
|
||||||
|
<index> - Column index. From 0 to max_columns - 1.
|
||||||
|
<days_ago> - Days ago for this column's time range.
|
||||||
|
<scrubbed> - Count of scrubbed blocks in that day.
|
||||||
|
<new> - Count of newly synced (unscrubbed) blocks in that day.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue