Add text file utility for SMART metrics#354
Conversation
Add a utility to parse the output of `smartctl`. * Scans all disks. * Prints metrics for `smartctl --info`. * Prints metrics for `smartctl --attributes`.
| # Get the SMART information | ||
| /usr/sbin/smartctl -i -d "${type}" "${disk}" | parse_smartctl_info "${disk}" "${type}" | ||
| # Get the SMART attributes | ||
| /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_attributes "${disk}" "${type}" |
There was a problem hiding this comment.
I think it'd be useful to add a gauge with "number of 'unknown attributes' found", both not to lose information and to sense new drives not yet in smartmontools database (i.e. usually with a high number of unknown attributes, IME)
There was a problem hiding this comment.
Ahh, that's an interesting idea. Also maybe a datestamp of the database file so you can monitor for out of date databases that way. But I think these might be interesting for a later release.
There was a problem hiding this comment.
@discordianfish We've been running this in production for a long time without issues. Having it do both in one shot makes for a much more complicated script.
Maybe sometime I can re-write this in python, but it works fine for now.
| # Get the SMART information | ||
| /usr/sbin/smartctl -i -d "${type}" "${disk}" | parse_smartctl_info "${disk}" "${type}" | ||
| # Get the SMART attributes | ||
| /usr/sbin/smartctl -A -d "${type}" "${disk}" | parse_smartctl_attributes "${disk}" "${type}" |
|
Fine with me, those are examples and not maintained as the core functionality anyways. |
Signed-off-by: Evan Lezar <evanlezar@gmail.com>
Add a utility to parse the output of
smartctl.smartctl --info.smartctl --attributes.