-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New SMART plugin #835
New SMART plugin #835
Conversation
e660940
to
4f426a4
Compare
ca48e74
to
68cea4a
Compare
30b7772
to
d4cc960
Compare
Hmm, just noticed that udisks actually reports precise temperature in Kelvins like |
Rebased against git master, ready for review. Will address the multipath stuff in a separate pull request. |
3cde901
to
6311fdd
Compare
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me in general, just some questions about the plugin priorities and small nitpicks.
S.M.A.R.T. plugin based on smartmontools, providing ATA SMART log retrieval. Requires smartmontools-7.0 with JSON output support. Only ATA SMART supported for the moment with possibility for SAS/SCSI monitoring.
Should generally work on any device type. Unfortunately smartctl doesn't always report errors in the JSON output, taking process exit code in account instead.
Testing locally created LIO, loop and scsi_debug devices, none of which actually support (ATA) SMART reporting, thus testing error cases only.
Dummy devices only, nothing useful in the JSON output either, no need for testing through the fake smartctl command.
This never worked as intended and was generally buggy, not being able to distinguish a real error code. By making the arguments less restricted this will also allow SAT protocol to be used. This commit serves as a point of git history in case someone wants to bring this functionality back.
…lues This introduces a level of abstraction for attribute names and its values. As long as the smartmontools drivedb is vastly inconsistent in attribute names, a whitelist for each well known attributes had to be introduced. It serves as a validation point as well and well known name is provided only once it passes the whitelist. Along with attribute name validation, a definition of attribute value unit is carried in the table. So besides the well known name a parsed value and its unit is provided as well.
34cece9
to
6dec261
Compare
Refactoring in preparation for a second implementation based on libatasmart.
Designated as a primary SMART plugin implementation, based on libatasmart code that has proven stable for a decade.
Reads the SMART data from a supplied blob instead from a disk. Provides testing functionality that has been present in UDisks for years (and likely ends up deprecated anyway). Most of the supplied skdump blobs were obtained from libatasmart bugzilla.
Since we already have a whitelist/conversion table between smartmontools drivedb.h-style attributes to a libatasmart well-known attribute names, an idea of additional validation against drivedb.h came up. This commit implements a very basic drivedb.h parser for a built-in include. This needs to be supplied externally from smartmontools (or downloaded separately for the build). When enabled, a drive model and firmware is matched against the drivedb regexes and non-matching attribute definitions are reported as 'unutrusted'/'unknown'.
When the commandline lvm plugin is disabled in build time yet lvm_dbus is enabled, the lvm.h header file wouldn't get installed.
Finally an example of a boiling temperature reported.
Libatasmart' temperature_cb() as iterated via sk_disk_smart_get_temperature() goes through the table and only the last available value of four matched attributes is reported back to the caller. This is different from smartmontools which defines matching priority. While there are four attributes to be matched, the latter two are actually overrides from the standard set. This is where drivedb comes into play, however for the moment we don't have forward checking. Thus only match storaged-project#194 and storaged-project#190, which are typically safe.
Jenkins, test this please. |
2 similar comments
Jenkins, test this please. |
Jenkins, test this please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now, thank you.
7e3790d
into
storaged-project:master
S.M.A.R.T. plugin based on smartmontools, providing ATA SMART log retrieval. Requires smartmontools-7.0 with JSON output support.
Only ATA SMART supported for the moment with possibility for SAS/SCSI monitoring.libblockdev-3.1
material.libblockdev-3.2
material.Fixes #823
TODO:
smartctl
command, supplying pre-grabbed JSON dumpsbd_smart_ata_set_enabled()
bd_smart_ata_device_self_test()
fix the low-power mode scenario (disabled by default in all tests), test it on a real spinning disk