prometheus-community / smartctl_exporter

Export smartctl statistics to prometheus
Apache License 2.0
264 stars 78 forks source link

Request for `smartctl --scan --json` output for non-standard systems #221

Open NiceGuyIT opened 3 months ago

NiceGuyIT commented 3 months ago

PR #188 added lots of test files containing smartctl output. To test PRs such as #205, it would be nice to have the output of smartctl --scan --json. Either add them as a comment below (use spoilers) or submit them in a PR. This data should not have any sensitive data so there's no need to redact anything.

6r4yf0x commented 2 months ago
1 ```json { "json_format_version": [ 1, 0 ], "smartctl": { "version": [ 7, 1 ], "svn_revision": "5022", "platform_info": "x86_64-linux-5.4.0-124-generic", "build_info": "(local build)", "argv": [ "smartctl", "--json", "--scan" ], "exit_status": 0 }, "devices": [ { "name": "/dev/sda", "info_name": "/dev/sda", "type": "scsi", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_01]", "type": "megaraid,1", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_02]", "type": "megaraid,2", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_03]", "type": "megaraid,3", "protocol": "SCSI" } ] } ```
2 ```json { "json_format_version": [ 1, 0 ], "smartctl": { "version": [ 7, 1 ], "svn_revision": "5022", "platform_info": "x86_64-linux-5.4.0-156-generic", "build_info": "(local build)", "argv": [ "smartctl", "--json", "--scan" ], "exit_status": 0 }, "devices": [ { "name": "/dev/sda", "info_name": "/dev/sda", "type": "scsi", "protocol": "SCSI" }, { "name": "/dev/sdb", "info_name": "/dev/sdb", "type": "scsi", "protocol": "SCSI" }, { "name": "/dev/sdc", "info_name": "/dev/sdc", "type": "scsi", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_04]", "type": "megaraid,4", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_05]", "type": "megaraid,5", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_06]", "type": "megaraid,6", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_07]", "type": "megaraid,7", "protocol": "SCSI" } ] } ```
3 ```json { "json_format_version": [ 1, 0 ], "smartctl": { "version": [ 7, 1 ], "svn_revision": "5022", "platform_info": "x86_64-linux-5.4.0-122-generic", "build_info": "(local build)", "argv": [ "smartctl", "--json", "--scan" ], "exit_status": 0 }, "devices": [ { "name": "/dev/sda", "info_name": "/dev/sda", "type": "scsi", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_17]", "type": "megaraid,17", "protocol": "SCSI" }, { "name": "/dev/bus/0", "info_name": "/dev/bus/0 [megaraid_disk_18]", "type": "megaraid,18", "protocol": "SCSI" } ] } ```
karl-rousseau commented 2 months ago

With the same idea, for SAS/SCSI drives, it would be nice to have those specific controller values taken into account when there are exported into JSON format using such command line:

smartctl -a -d cciss,0 /dev/sda --json=u

And there is an important HDD health metric to monitor:

"smartctl_0043_u": "Non-medium error count: 626",

When the disk is brand new, this value is equal to zero and with time, it will increase. It is very similar to the SATA one named "Reallocated sector count".