When logging device attributes, also provide the split information

This commit is contained in:
Andrea Mazzoleni 2025-12-21 15:55:52 +01:00
parent bb3aae2f40
commit efcdfb9118
8 changed files with 119 additions and 101 deletions

View file

@ -21,6 +21,14 @@
#include "state.h"
#include "raid/raid.h"
void device_name_set(devinfo_t* dev, const char* name, int index)
{
if (index == 0)
pathcpy(dev->name, sizeof(dev->name), name);
else
pathprint(dev->name, sizeof(dev->name), "%s/%d", name, index);
}
/**
* The following are Failure Rate tables computed from the data that
* BackBlaze made available at:
@ -881,7 +889,7 @@ int devtest(tommy_list* high, tommy_list* low, int operation)
pathprint(entry->serial, sizeof(entry->serial), "FAKE_%s", devinfo->serial);
pathprint(entry->vendor, sizeof(entry->vendor), "FAKE_%s", devinfo->vendor);
pathprint(entry->model, sizeof(entry->model), "FAKE_%s", devinfo->model);
pathprint(entry->file, sizeof(entry->name), "FAKE_%s", devinfo->file);
pathprint(entry->file, sizeof(entry->file), "FAKE_%s", devinfo->file);
pathcpy(entry->name, sizeof(entry->name), devinfo->name);
entry->info[INFO_SIZE] = count * TERA;
entry->info[INFO_ROTATION_RATE] = 7200;
@ -934,7 +942,7 @@ void state_device(struct snapraid_state* state, int operation, tommy_list* filte
entry = calloc_nofail(1, sizeof(devinfo_t));
entry->device = disk->device;
pathcpy(entry->name, sizeof(entry->name), disk->name);
device_name_set(entry, disk->name, 0);
pathcpy(entry->mount, sizeof(entry->mount), disk->dir);
pathcpy(entry->smartctl, sizeof(entry->smartctl), disk->smartctl);
memcpy(entry->smartignore, disk->smartignore, sizeof(entry->smartignore));
@ -954,7 +962,7 @@ void state_device(struct snapraid_state* state, int operation, tommy_list* filte
entry = calloc_nofail(1, sizeof(devinfo_t));
entry->device = state->parity[j].split_map[s].device;
pathcpy(entry->name, sizeof(entry->name), lev_config_name(j));
device_name_set(entry, lev_config_name(j), s);
pathcpy(entry->mount, sizeof(entry->mount), state->parity[j].split_map[s].path);
pathcpy(entry->smartctl, sizeof(entry->smartctl), state->parity[j].smartctl);
memcpy(entry->smartignore, state->parity[j].smartignore, sizeof(entry->smartignore));

View file

@ -2312,7 +2312,7 @@ static int devresolve(const char* mount, char* file, size_t file_size, char* wfi
/**
* Read a device tree filling the specified list of disk_t entries.
*/
static int devtree(const char* name, const char* smartctl, const int* smartignore, const char* wfile, devinfo_t* parent, tommy_list* list)
static int devtree(devinfo_t* parent, tommy_list* list)
{
wchar_t conv_buf[CONV_MAX];
HANDLE h;
@ -2325,7 +2325,7 @@ static int devtree(const char* name, const char* smartctl, const int* smartignor
DWORD i;
/* open the volume */
h = CreateFileW(convert(conv_buf, wfile), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
h = CreateFileW(convert(conv_buf, parent->wfile), 0, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
if (h == INVALID_HANDLE_VALUE) {
windows_errno(GetLastError());
return -1;
@ -2360,9 +2360,9 @@ static int devtree(const char* name, const char* smartctl, const int* smartignor
devinfo = calloc_nofail(1, sizeof(devinfo_t));
pathcpy(devinfo->name, sizeof(devinfo->name), name);
pathcpy(devinfo->smartctl, sizeof(devinfo->smartctl), smartctl);
memcpy(devinfo->smartignore, smartignore, sizeof(devinfo->smartignore));
pathcpy(devinfo->name, sizeof(devinfo->name), parent->name);
pathcpy(devinfo->smartctl, sizeof(devinfo->smartctl), parent->smartctl);
memcpy(devinfo->smartignore, parent->smartignore, sizeof(devinfo->smartignore));
devinfo->device = vde->Extents[i].DiskNumber;
pathprint(devinfo->file, sizeof(devinfo->file), "/dev/pd%" PRIu64, devinfo->device);
pathprint(devinfo->wfile, sizeof(devinfo->wfile), "\\\\.\\PhysicalDrive%" PRIu64, devinfo->device);
@ -2992,7 +2992,7 @@ int devquery(tommy_list* high, tommy_list* low, int operation, int others)
}
/* expand the tree of devices */
if (devtree(devinfo->name, devinfo->smartctl, devinfo->smartignore, devinfo->wfile, devinfo, low) != 0) {
if (devtree(devinfo, low) != 0) {
/* LCOV_EXCL_START */
log_fatal("Failed to expand device '%s'.\n", devinfo->file);
return -1;

View file

@ -504,7 +504,7 @@ int randomize(void* ptr, size_t size);
*/
struct devinfo_struct {
uint64_t device; /**< Device ID. */
char name[PATH_MAX]; /**< Name of the disk. */
char name[PATH_MAX]; /**< Name of the disk combined with the split index if any */
char mount[PATH_MAX]; /**< Mount point or other contained directory. */
char smartctl[PATH_MAX]; /**< Options for smartctl. */
int smartignore[SMART_IGNORE_MAX]; /**< Attribues to ignore */
@ -526,6 +526,8 @@ struct devinfo_struct {
};
typedef struct devinfo_struct devinfo_t;
void device_name_set(devinfo_t* dev, const char* name, int index);
#define DEVICE_LIST 0
#define DEVICE_DOWN 1
#define DEVICE_UP 2

View file

@ -159,7 +159,7 @@ void state_thermal(struct snapraid_state* state, time_t now)
entry = calloc_nofail(1, sizeof(devinfo_t));
entry->device = disk->device;
pathcpy(entry->name, sizeof(entry->name), disk->name);
device_name_set(entry, disk->name, 0);
pathcpy(entry->mount, sizeof(entry->mount), disk->dir);
pathcpy(entry->smartctl, sizeof(entry->smartctl), disk->smartctl);
memcpy(entry->smartignore, disk->smartignore, sizeof(entry->smartignore));
@ -176,7 +176,7 @@ void state_thermal(struct snapraid_state* state, time_t now)
entry = calloc_nofail(1, sizeof(devinfo_t));
entry->device = state->parity[j].split_map[s].device;
pathcpy(entry->name, sizeof(entry->name), lev_config_name(j));
device_name_set(entry, lev_config_name(j), s);
pathcpy(entry->mount, sizeof(entry->mount), state->parity[j].split_map[s].path);
pathcpy(entry->smartctl, sizeof(entry->smartctl), state->parity[j].smartctl);
memcpy(entry->smartignore, state->parity[j].smartignore, sizeof(entry->smartignore));

View file

@ -993,7 +993,7 @@ static dev_t devread(const char* path)
* Read a device tree filling the specified list of disk_t entries.
*/
#if HAVE_LINUX_DEVICE
static int devtree(const char* name, const char* smartctl, const int* smartignore, dev_t device, devinfo_t* parent, tommy_list* list)
static int devtree(devinfo_t* parent, dev_t device, tommy_list* list)
{
char path[PATH_MAX];
DIR* d;
@ -1021,7 +1021,7 @@ static int devtree(const char* name, const char* smartctl, const int* smartignor
/* LCOV_EXCL_STOP */
}
if (devtree(name, smartctl, smartignore, subdev, parent, list) != 0) {
if (devtree(parent, subdev, list) != 0) {
/* LCOV_EXCL_START */
closedir(d);
return -1;
@ -1065,9 +1065,9 @@ static int devtree(const char* name, const char* smartctl, const int* smartignor
devinfo = calloc_nofail(1, sizeof(devinfo_t));
devinfo->device = device;
pathcpy(devinfo->name, sizeof(devinfo->name), name);
pathcpy(devinfo->smartctl, sizeof(devinfo->smartctl), smartctl);
memcpy(devinfo->smartignore, smartignore, sizeof(devinfo->smartignore));
pathcpy(devinfo->name, sizeof(devinfo->name), parent->name);
pathcpy(devinfo->smartctl, sizeof(devinfo->smartctl), parent->smartctl);
memcpy(devinfo->smartignore, parent->smartignore, sizeof(devinfo->smartignore));
pathcpy(devinfo->file, sizeof(devinfo->file), path);
devinfo->parent = parent;
@ -1713,7 +1713,7 @@ int devquery(tommy_list* high, tommy_list* low, int operation, int others)
}
/* expand the tree of devices */
if (devtree(devinfo->name, devinfo->smartctl, devinfo->smartignore, device, devinfo, low) != 0) {
if (devtree(devinfo, device, low) != 0) {
/* LCOV_EXCL_START */
log_fatal("Failed to expand device '%u:%u'.\n", major(device), minor(device));
return -1;

View file

@ -504,14 +504,16 @@ The calculated ambient temperature in degrees Celsius.
.PD
.RE
.TP
.B thermal:current:<disk_name>:<device>:<temp>
.B thermal:current:<disk_name>[/<split_number>]:<device>:<temp>
Logs the most recent temperature reading for a specific disk
device.
.RS 4
.PD 0
.HP 4
.I <disk_name>
.I <disk_name>[/<split_number>]
The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension \`/N\`, where N starts from 1.
.HP 4
.I <device>
The unique device ID (uint64).
@ -534,16 +536,13 @@ The highest temperature observed in degrees Celsius.
.PD
.RE
.TP
.B thermal:heat:<disk_name>:<device>:<count>:<data_points>
.B thermal:heat:<disk_name>[/<split_number>]:<device>:<count>:<data_points>
Logs the entire history of temperature data points collected
so far for a specific disk, used for fitting the heating model.
Only monotone increasing temperatures are included in the history.
.RS 4
.PD 0
.HP 4
.I <disk_name>
The configured name of the disk.
.HP 4
.I <device>
The unique device ID (uint64).
.HP 4
@ -563,7 +562,7 @@ monitoring (uint, seconds).
.PD
.RE
.TP
.B thermal:params:<disk_name>:<device>:<k_heat>:<t_ambient>:<t_steady>:<rmse>:<r_squared>:<max_error>
.B thermal:params:<disk_name>[/<split_number>]:<device>:<k_heat>:<t_ambient>:<t_steady>:<rmse>:<r_squared>:<max_error>
Logs the estimated parameters for the exponential heating model
(fit using least squares) and associated quality metrics for a
specific disk.
@ -572,9 +571,6 @@ where T_0 is the initial temperature.
.RS 4
.PD 0
.HP 4
.I <disk_name>
The configured name of the disk.
.HP 4
.I <device>
The unique device ID (uint64).
.HP 4
@ -1448,7 +1444,7 @@ you\'ll see multiple tags for the same \`<disk_name>\` but with different
Tags logging specific disk identification and raw SMART attribute
values.
.TP
.B smart:<device_file>:<disk_name>
.B smart:<device_file>:<disk_name>[/<split_number>]
Logs the start of the SMART report for a device.
.RS 4
.PD 0
@ -1456,12 +1452,14 @@ Logs the start of the SMART report for a device.
.I <device_file>
The file path of the device (e.g., /dev/sdb).
.HP 4
.I <disk_name>
.I <disk_name>[/<split_number>]
The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension \`/N\`, where N starts from 1.
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:serial:<serial_number>
.B attr:<device_file>:<disk_name>[/<split_number>]:serial:<serial_number>
Logs the disk\'s serial number.
.RS 4
.PD 0
@ -1471,7 +1469,7 @@ The disk\'s serial number (escaped).
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:vendor:<vendor>
.B attr:<device_file>:<disk_name>[/<split_number>]:vendor:<vendor>
Logs the disk\'s vendor string.
.RS 4
.PD 0
@ -1481,7 +1479,7 @@ The disk\'s vendor identifier (escaped).
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:model:<model>
.B attr:<device_file>:<disk_name>[/<split_number>]:model:<model>
Logs the disk\'s model string.
.RS 4
.PD 0
@ -1491,7 +1489,7 @@ The disk\'s model identifier (escaped).
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:afr:<afr_value>:<afr_prob>
.B attr:<device_file>:<disk_name>[/<split_number>]:afr:<afr_value>:<afr_prob>
Logs the estimated Annual Failure Rate (AFR) and the
probability of one failure in the next year based on SMART
attributes. The AFR is calculated using the maximum rate
@ -1508,7 +1506,7 @@ next year (double).
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:size:<size_bytes>
.B attr:<device_file>:<disk_name>[/<split_number>]:size:<size_bytes>
Logs the size of the disk.
.RS 4
.PD 0
@ -1518,7 +1516,7 @@ The disk size in bytes (uint64).
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:error:<error_count>
.B attr:<device_file>:<disk_name>[/<split_number>]:error:<error_count>
Logs the total error count.
.RS 4
.PD 0
@ -1528,7 +1526,7 @@ The total error count (uint64).
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:rotationrate:<rate>
.B attr:<device_file>:<disk_name>[/<split_number>]:rotationrate:<rate>
Logs the disk\'s rotation rate. A value of 0 indicates an SSD.
.RS 4
.PD 0
@ -1538,7 +1536,7 @@ The rotation rate (uint64, RPM).
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:flags:<flags_decimal>:<flags_hex>
.B attr:<device_file>:<disk_name>[/<split_number>]:flags:<flags_decimal>:<flags_hex>
Logs the SMART status flags from the \`smartctl\` utility.
Per the smartctl manpage, these flags are bit\-mapped
to indicate specific issues like \[dq]Command line did not parse\[dq],
@ -1555,7 +1553,7 @@ The raw flags value (uint64, hexadecimal).
.PD
.RE
.TP
.B attr:<device_file>:<disk_name>:<id>:<value_decimal>:<value_hex>
.B attr:<device_file>:<disk_name>[/<split_number>]:<id>:<value_decimal>:<value_hex>
Logs the raw value of any assigned SMART attribute.
.RS 4
.PD 0
@ -1596,7 +1594,7 @@ command execution. They are primarily output during the \`up\`
(spin\-up), \`down\` (spin\-down), and \`probe\` (power state check)
commands.
.TP
.B device:<device_file>:<disk_name>:active
.B device:<device_file>:<disk_name>[/<split_number>]:active
Logs that the device was confirmed to be in an active power
state after a status probe.
.RS 4
@ -1605,27 +1603,29 @@ state after a status probe.
.I <device_file>
The system path to the device node.
.HP 4
.I <disk_name>
The SnapRAID internal disk disk_name.
.I <disk_name>[/<split_number>]
The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension \`/N\`, where N starts from 1.
.PD
.RE
.TP
.B device:<device_file>:<disk_name>:standby
.B device:<device_file>:<disk_name>[/<split_number>]:standby
Logs that the device was confirmed to be in a standby/spun\-down
state.
.TP
.B device:<device_file>:<disk_name>:up
.B device:<device_file>:<disk_name>[/<split_number>]:up
Logs a successful spin\-up operation via direct O_DIRECT
read.
.TP
.B device:<device_file>:<disk_name>:down
.B device:<device_file>:<disk_name>[/<split_number>]:down
Logs a successful spin\-down operation initiated via the
smartctl command.
.TP
.B device:<device_file>:<disk_name>:shell
.B device:<device_file>:<disk_name>[/<split_number>]:shell
Logs a failure in the command shell execution environment.
.TP
.B device:<device_file>:<disk_name>:error:<errno>
.B device:<device_file>:<disk_name>[/<split_number>]:error:<errno>
Logs a low\-level system error during direct file operations.
This is triggered when open(), read(), or close()
calls fail during a spin\-up attempt.
@ -1638,12 +1638,12 @@ the OS.
.PD
.RE
.TP
.B device:<device_file>:<disk_name>:error:abort
.B device:<device_file>:<disk_name>[/<split_number>]:error:abort
Logs that an external process (smartctl) failed to complete
normally, such as being terminated by a signal rather than
exiting.
.TP
.B device:<device_file>:<disk_name>:exit:<exit_code>
.B device:<device_file>:<disk_name>[/<split_number>]:exit:<exit_code>
Logs that the external command (smartctl) returned a non\-zero
exit code that was not explicitly recognized as a valid state.
.RS 4

View file

@ -340,11 +340,13 @@ Thermal Tags
<temp> - The calculated ambient temperature in degrees Celsius.
=thermal:current:<disk_name>:<device>:<temp>
=thermal:current:<disk_name>[/<split_number>]:<device>:<temp>
Logs the most recent temperature reading for a specific disk
device.
<disk_name> - The configured name of the disk.
<disk_name>[/<split_number>] - The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension `/N`, where N starts from 1.
<device> - The unique device ID (uint64).
<temp> - The current temperature read from the disk in degrees
Celsius.
@ -356,12 +358,11 @@ Thermal Tags
<temp> - The highest temperature observed in degrees Celsius.
=thermal:heat:<disk_name>:<device>:<count>:<data_points>
=thermal:heat:<disk_name>[/<split_number>]:<device>:<count>:<data_points>
Logs the entire history of temperature data points collected
so far for a specific disk, used for fitting the heating model.
Only monotone increasing temperatures are included in the history.
<disk_name> - The configured name of the disk.
<device> - The unique device ID (uint64).
<count> - The total number of collected data points (uint).
<data_points> - A comma-separated list of temperature/time pairs.
@ -370,14 +371,13 @@ Thermal Tags
<time_offset> - Time offset from the start of the thermal
monitoring (uint, seconds).
=thermal:params:<disk_name>:<device>:<k_heat>:<t_ambient>:<t_steady>:<rmse>:<r_squared>:<max_error>
=thermal:params:<disk_name>[/<split_number>]:<device>:<k_heat>:<t_ambient>:<t_steady>:<rmse>:<r_squared>:<max_error>
Logs the estimated parameters for the exponential heating model
(fit using least squares) and associated quality metrics for a
specific disk.
The model is: T(t) = T_steady - (T_steady - T_0) e^(-kt),
where T_0 is the initial temperature.
<disk_name> - The configured name of the disk.
<device> - The unique device ID (uint64).
<k_heat> - The heating rate constant, k (double).
<t_ambient> - The ambient temperature, T_ambient (double).
@ -926,28 +926,30 @@ Command Smart Tags
Tags logging specific disk identification and raw SMART attribute
values.
=smart:<device_file>:<disk_name>
=smart:<device_file>:<disk_name>[/<split_number>]
Logs the start of the SMART report for a device.
<device_file> - The file path of the device (e.g., /dev/sdb).
<disk_name> - The configured name of the disk.
<disk_name>[/<split_number>] - The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension `/N`, where N starts from 1.
=attr:<device_file>:<disk_name>:serial:<serial_number>
=attr:<device_file>:<disk_name>[/<split_number>]:serial:<serial_number>
Logs the disk's serial number.
<serial_number> - The disk's serial number (escaped).
=attr:<device_file>:<disk_name>:vendor:<vendor>
=attr:<device_file>:<disk_name>[/<split_number>]:vendor:<vendor>
Logs the disk's vendor string.
<vendor> - The disk's vendor identifier (escaped).
=attr:<device_file>:<disk_name>:model:<model>
=attr:<device_file>:<disk_name>[/<split_number>]:model:<model>
Logs the disk's model string.
<model> - The disk's model identifier (escaped).
=attr:<device_file>:<disk_name>:afr:<afr_value>:<afr_prob>
=attr:<device_file>:<disk_name>[/<split_number>]:afr:<afr_value>:<afr_prob>
Logs the estimated Annual Failure Rate (AFR) and the
probability of one failure in the next year based on SMART
attributes. The AFR is calculated using the maximum rate
@ -957,22 +959,22 @@ Command Smart Tags
<afr_prob> - The probability of one or more failures in the
next year (double).
=attr:<device_file>:<disk_name>:size:<size_bytes>
=attr:<device_file>:<disk_name>[/<split_number>]:size:<size_bytes>
Logs the size of the disk.
<size_bytes> - The disk size in bytes (uint64).
=attr:<device_file>:<disk_name>:error:<error_count>
=attr:<device_file>:<disk_name>[/<split_number>]:error:<error_count>
Logs the total error count.
<error_count> - The total error count (uint64).
=attr:<device_file>:<disk_name>:rotationrate:<rate>
=attr:<device_file>:<disk_name>[/<split_number>]:rotationrate:<rate>
Logs the disk's rotation rate. A value of 0 indicates an SSD.
<rate> - The rotation rate (uint64, RPM).
=attr:<device_file>:<disk_name>:flags:<flags_decimal>:<flags_hex>
=attr:<device_file>:<disk_name>[/<split_number>]:flags:<flags_decimal>:<flags_hex>
Logs the SMART status flags from the `smartctl` utility.
Per the smartctl manpage, these flags are bit-mapped
to indicate specific issues like "Command line did not parse",
@ -982,7 +984,7 @@ Command Smart Tags
<flags_decimal> - The raw flags value (uint64, decimal).
<flags_hex> - The raw flags value (uint64, hexadecimal).
=attr:<device_file>:<disk_name>:<id>:<value_decimal>:<value_hex>
=attr:<device_file>:<disk_name>[/<split_number>]:<id>:<value_decimal>:<value_hex>
Logs the raw value of any assigned SMART attribute.
<id> - The SMART attribute ID (uint).
@ -1007,29 +1009,31 @@ Device Status Tags
(spin-up), `down` (spin-down), and `probe` (power state check)
commands.
=device:<device_file>:<disk_name>:active
=device:<device_file>:<disk_name>[/<split_number>]:active
Logs that the device was confirmed to be in an active power
state after a status probe.
<device_file> - The system path to the device node.
<disk_name> - The SnapRAID internal disk disk_name.
<disk_name>[/<split_number>] - The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension `/N`, where N starts from 1.
=device:<device_file>:<disk_name>:standby
=device:<device_file>:<disk_name>[/<split_number>]:standby
Logs that the device was confirmed to be in a standby/spun-down
state.
=device:<device_file>:<disk_name>:up
=device:<device_file>:<disk_name>[/<split_number>]:up
Logs a successful spin-up operation via direct O_DIRECT
read.
=device:<device_file>:<disk_name>:down
=device:<device_file>:<disk_name>[/<split_number>]:down
Logs a successful spin-down operation initiated via the
smartctl command.
=device:<device_file>:<disk_name>:shell
=device:<device_file>:<disk_name>[/<split_number>]:shell
Logs a failure in the command shell execution environment.
=device:<device_file>:<disk_name>:error:<errno>
=device:<device_file>:<disk_name>[/<split_number>]:error:<errno>
Logs a low-level system error during direct file operations.
This is triggered when open(), read(), or close()
calls fail during a spin-up attempt.
@ -1037,12 +1041,12 @@ Device Status Tags
<errno> - The standard integer error number provided by
the OS.
=device:<device_file>:<disk_name>:error:abort
=device:<device_file>:<disk_name>[/<split_number>]:error:abort
Logs that an external process (smartctl) failed to complete
normally, such as being terminated by a signal rather than
exiting.
=device:<device_file>:<disk_name>:exit:<exit_code>
=device:<device_file>:<disk_name>[/<split_number>]:exit:<exit_code>
Logs that the external command (smartctl) returned a non-zero
exit code that was not explicitly recognized as a valid state.

View file

@ -358,11 +358,13 @@ disk access.
<temp> - The calculated ambient temperature in degrees Celsius.
thermal:current:<disk_name>:<device>:<temp>
thermal:current:<disk_name>[/<split_number>]:<device>:<temp>
Logs the most recent temperature reading for a specific disk
device.
<disk_name> - The configured name of the disk.
<disk_name>[/<split_number>] - The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension `/N`, where N starts from 1.
<device> - The unique device ID (uint64).
<temp> - The current temperature read from the disk in degrees
Celsius.
@ -374,12 +376,11 @@ disk access.
<temp> - The highest temperature observed in degrees Celsius.
thermal:heat:<disk_name>:<device>:<count>:<data_points>
thermal:heat:<disk_name>[/<split_number>]:<device>:<count>:<data_points>
Logs the entire history of temperature data points collected
so far for a specific disk, used for fitting the heating model.
Only monotone increasing temperatures are included in the history.
<disk_name> - The configured name of the disk.
<device> - The unique device ID (uint64).
<count> - The total number of collected data points (uint).
<data_points> - A comma-separated list of temperature/time pairs.
@ -388,14 +389,13 @@ disk access.
<time_offset> - Time offset from the start of the thermal
monitoring (uint, seconds).
thermal:params:<disk_name>:<device>:<k_heat>:<t_ambient>:<t_steady>:<rmse>:<r_squared>:<max_error>
thermal:params:<disk_name>[/<split_number>]:<device>:<k_heat>:<t_ambient>:<t_steady>:<rmse>:<r_squared>:<max_error>
Logs the estimated parameters for the exponential heating model
(fit using least squares) and associated quality metrics for a
specific disk.
The model is: T(t) = T_steady - (T_steady - T_0) e^(-kt),
where T_0 is the initial temperature.
<disk_name> - The configured name of the disk.
<device> - The unique device ID (uint64).
<k_heat> - The heating rate constant, k (double).
<t_ambient> - The ambient temperature, T_ambient (double).
@ -968,28 +968,30 @@ you'll see multiple tags for the same `<disk_name>` but with different
Tags logging specific disk identification and raw SMART attribute
values.
smart:<device_file>:<disk_name>
smart:<device_file>:<disk_name>[/<split_number>]
Logs the start of the SMART report for a device.
<device_file> - The file path of the device (e.g., /dev/sdb).
<disk_name> - The configured name of the disk.
<disk_name>[/<split_number>] - The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension `/N`, where N starts from 1.
attr:<device_file>:<disk_name>:serial:<serial_number>
attr:<device_file>:<disk_name>[/<split_number>]:serial:<serial_number>
Logs the disk's serial number.
<serial_number> - The disk's serial number (escaped).
attr:<device_file>:<disk_name>:vendor:<vendor>
attr:<device_file>:<disk_name>[/<split_number>]:vendor:<vendor>
Logs the disk's vendor string.
<vendor> - The disk's vendor identifier (escaped).
attr:<device_file>:<disk_name>:model:<model>
attr:<device_file>:<disk_name>[/<split_number>]:model:<model>
Logs the disk's model string.
<model> - The disk's model identifier (escaped).
attr:<device_file>:<disk_name>:afr:<afr_value>:<afr_prob>
attr:<device_file>:<disk_name>[/<split_number>]:afr:<afr_value>:<afr_prob>
Logs the estimated Annual Failure Rate (AFR) and the
probability of one failure in the next year based on SMART
attributes. The AFR is calculated using the maximum rate
@ -999,22 +1001,22 @@ values.
<afr_prob> - The probability of one or more failures in the
next year (double).
attr:<device_file>:<disk_name>:size:<size_bytes>
attr:<device_file>:<disk_name>[/<split_number>]:size:<size_bytes>
Logs the size of the disk.
<size_bytes> - The disk size in bytes (uint64).
attr:<device_file>:<disk_name>:error:<error_count>
attr:<device_file>:<disk_name>[/<split_number>]:error:<error_count>
Logs the total error count.
<error_count> - The total error count (uint64).
attr:<device_file>:<disk_name>:rotationrate:<rate>
attr:<device_file>:<disk_name>[/<split_number>]:rotationrate:<rate>
Logs the disk's rotation rate. A value of 0 indicates an SSD.
<rate> - The rotation rate (uint64, RPM).
attr:<device_file>:<disk_name>:flags:<flags_decimal>:<flags_hex>
attr:<device_file>:<disk_name>[/<split_number>]:flags:<flags_decimal>:<flags_hex>
Logs the SMART status flags from the `smartctl` utility.
Per the smartctl manpage, these flags are bit-mapped
to indicate specific issues like "Command line did not parse",
@ -1024,7 +1026,7 @@ values.
<flags_decimal> - The raw flags value (uint64, decimal).
<flags_hex> - The raw flags value (uint64, hexadecimal).
attr:<device_file>:<disk_name>:<id>:<value_decimal>:<value_hex>
attr:<device_file>:<disk_name>[/<split_number>]:<id>:<value_decimal>:<value_hex>
Logs the raw value of any assigned SMART attribute.
<id> - The SMART attribute ID (uint).
@ -1052,29 +1054,31 @@ command execution. They are primarily output during the `up`
(spin-up), `down` (spin-down), and `probe` (power state check)
commands.
device:<device_file>:<disk_name>:active
device:<device_file>:<disk_name>[/<split_number>]:active
Logs that the device was confirmed to be in an active power
state after a status probe.
<device_file> - The system path to the device node.
<disk_name> - The SnapRAID internal disk disk_name.
<disk_name>[/<split_number>] - The configured name of the disk.
In case of multiple splits, the splits after the first
one have an extension `/N`, where N starts from 1.
device:<device_file>:<disk_name>:standby
device:<device_file>:<disk_name>[/<split_number>]:standby
Logs that the device was confirmed to be in a standby/spun-down
state.
device:<device_file>:<disk_name>:up
device:<device_file>:<disk_name>[/<split_number>]:up
Logs a successful spin-up operation via direct O_DIRECT
read.
device:<device_file>:<disk_name>:down
device:<device_file>:<disk_name>[/<split_number>]:down
Logs a successful spin-down operation initiated via the
smartctl command.
device:<device_file>:<disk_name>:shell
device:<device_file>:<disk_name>[/<split_number>]:shell
Logs a failure in the command shell execution environment.
device:<device_file>:<disk_name>:error:<errno>
device:<device_file>:<disk_name>[/<split_number>]:error:<errno>
Logs a low-level system error during direct file operations.
This is triggered when open(), read(), or close()
calls fail during a spin-up attempt.
@ -1082,12 +1086,12 @@ commands.
<errno> - The standard integer error number provided by
the OS.
device:<device_file>:<disk_name>:error:abort
device:<device_file>:<disk_name>[/<split_number>]:error:abort
Logs that an external process (smartctl) failed to complete
normally, such as being terminated by a signal rather than
exiting.
device:<device_file>:<disk_name>:exit:<exit_code>
device:<device_file>:<disk_name>[/<split_number>]:exit:<exit_code>
Logs that the external command (smartctl) returned a non-zero
exit code that was not explicitly recognized as a valid state.