* Remove `"`, `(` and `)` from file names (see #188)
* Added regex ignore for some devices, fixes:
```
Collecting data for '/dev/sda'... Saving to sat-Intel_S4510_S4610_S4500_S4600_Series_SSDs-INTEL_SSDSC2KB240G8-sda.json
Collecting data for '/dev/sdb'... Saving to sat-Intel_S4510_S4610_S4500_S4600_Series_SSDs-INTEL_SSDSC2KB240G8-sdb.json
Collecting data for '/dev/bus/0'...jq: error (at <stdin>:34): null (null) cannot be matched, as it is not a string
Saving to null-null--0.json
Collecting data for '/dev/bus/0'...jq: error (at <stdin>:34): null (null) cannot be matched, as it is not a string
Saving to null-null--0.json
Collecting data for '/dev/nvme0'... Saving to nvme-null-HUSMR7632BHP301-nvme0.json
Collecting data for '/dev/nvme1'... Saving to nvme-null-HUSMR7632BHP301-nvme1.json
Collecting data for '/dev/nvme2'... Saving to nvme-null-HUSMR7632BHP301-nvme2.json
Collecting data for '/dev/nvme3'... Saving to nvme-null-HUSMR7632BHP301-nvme3.json
Collecting data for '/dev/nvme4'... Saving to nvme-null-HUSMR7632BHP301-nvme4.json
```
The `/dev/bus/*` is some pseudo-device comes with Broadcom driver, after fix:
```
Collecting data for '/dev/sda'... Saving to sat-Intel_S4510_S4610_S4500_S4600_Series_SSDs-INTEL_SSDSC2KB240G8-sda.json
Collecting data for '/dev/sdb'... Saving to sat-Intel_S4510_S4610_S4500_S4600_Series_SSDs-INTEL_SSDSC2KB240G8-sdb.json
Collecting data for '/dev/nvme0'... Saving to nvme-null-HUSMR7632BHP301-nvme0.json
Collecting data for '/dev/nvme1'... Saving to nvme-null-HUSMR7632BHP301-nvme1.json
Collecting data for '/dev/nvme2'... Saving to nvme-null-HUSMR7632BHP301-nvme2.json
Collecting data for '/dev/nvme3'... Saving to nvme-null-HUSMR7632BHP301-nvme3.json
Collecting data for '/dev/nvme4'... Saving to nvme-null-HUSMR7632BHP301-nvme4.json
```
Signed-off-by: Konstantin Shalygin <k0ste@k0ste.ru>
- Add README about test data.
- Add script to redact sensitive fields.
- Add JSON testing data collected from many systems, with redaction of
sensitive fields.
The initial corpus includes:
- NVME drives
- SAS drives - HDD only, no SSD
- SCSI drives - HDD only, no SSD
- SATA drives - SSD & HDD
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Fix the following metrics that were exported as zero because the
exporter did not know how to read them for SCSI devices:
- smartctl_device_bytes_read
- smartctl_device_bytes_written
- smartctl_device_power_cycle_count
New metrics:
- smartctl_read_errors_corrected_by_eccdelayed
- smartctl_read_errors_corrected_by_eccfast
- smartctl_write_errors_corrected_by_eccdelayed
- smartctl_write_errors_corrected_by_eccfast
Fix labels:
- smartctl_device{model_name} is now populated for SCSI/SAS, using
scsi_model_name.
New labels:
- smartctl_device{} gains:
scsi_product,scsi_revision,scsi_vendor,scsi_version
Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com>
The exporter presently has metrics that are nonsense for a given type of
drive, and remain at zero due to their defaults.
Change the behavior to NOT emit a metric if the underlying JSON field is
not present.
Future related work may include parsing the corresponding metrics for
SATA/SAS SSDs (e.g. `smartctl_device_percentage_used` could derived from
`SSD_Life_Left` on some drives).
Metrics no longer exported for the wrong type of drive:
- `smartctl_device_nvme_capacity_bytes` (NVME-specific)
- `smartctl_device_available_spare` (NVME-specific, ATA possible)
- `smartctl_device_available_spare_threshold` (NVME-specific, ATA
possible)
- `smartctl_device_critical_warning` (NVME-specific, ATA possible)
- `smartctl_device_interface_speed` (ATA-specific)
- `smartctl_device_media_errors` (NVME-specific, ATA possible)
- `smartctl_device_num_err_log_entries` (NVME-specific, SCSI uses
distinct metrics, ATA possible)
- `smartctl_device_nvme_capacity_bytes` (NVME-specific)
- `smartctl_device_percentage_used` (NVME-specific, ATA possible)
Signed-off-by: Robin H. Johnson <rjohnson@coreweave.com>