smart: add a SMART plugin
This plugin uses libatasmart:
http://0pointer.de/blog/projects/being-smart.html
As libatasmart is Linux-only, the plugin is therefore Linux-only
too. The disks are discovered through libudev.
Each SMART attribute is extracted. The current value, worst value,
threshold value (if any) are recorded. Those are normalized
values (between 0 and 255, higher is better). For some values, it makes
more sense to record the raw value. libatasmart is converting this raw
value to something sensible. We record that form. Sometimes, this is
just the raw value but sometimes this is converted to another scale (for
example, the temperature). People should know what each attribute means
before using those values. Otherwise, the normalized values are better.
Four values are (power-on time, power cycle count, bad sectors and
temperature) are also recorded on their own. Those are usually the
values that the user care about the most.
Here is an excerpt of the plugin output with the CSV plugin (the SSD
disk on my laptop doesn't provide a temperature sensor):
.
└── zoro.exoscale.ch
└── smart-sda
├── smart_attribute-attribute-173-2014-11-10
├── smart_attribute-attribute-174-2014-11-10
├── smart_attribute-available-reserved-space-2014-11-10
├── smart_attribute-end-to-end-error-2014-11-10
├── smart_attribute-erase-fail-count-2014-11-10
├── smart_attribute-power-cycle-count-2014-11-10
├── smart_attribute-power-on-hours-2014-11-10
├── smart_attribute-power-on-seconds-2-2014-11-10
├── smart_attribute-program-fail-count-2014-11-10
├── smart_attribute-reallocated-sector-count-2014-11-10
├── smart_attribute-reported-uncorrect-2014-11-10
├── smart_attribute-total-lbas-read-2014-11-10
├── smart_attribute-total-lbas-written-2014-11-10
├── smart_attribute-udma-crc-error-count-2014-11-10
├── smart_attribute-unused-reserved-blocks-2014-11-10
├── smart_attribute-used-reserved-blocks-chip-2014-11-10
├── smart_badsectors-2014-11-10
├── smart_powercycles-2014-11-10
└── smart_poweron-2014-11-10
$ cat zoro.exoscale.ch/smart-sda/smart_attribute-total-lbas-read-2014-11-10
epoch,current,worst,threshold,pretty
1415613266.376,100.000000,100.000000,0.000000,281018.000000
1415613276.395,100.000000,100.000000,0.000000,281018.000000
1415613286.384,100.000000,100.000000,0.000000,281051.000000
1415613296.383,100.000000,100.000000,0.000000,281051.000000