sensu-plugins / sensu-plugins-disk-checks

This plugin provides native disk instrumentation for monitoring and metrics collection, including: health, usage, and various metrics.
http://sensu-plugins.io
MIT License
27 stars 63 forks source link

check-smart.rb: more flexible with smartctl output whitespace #74

Closed robx closed 7 years ago

robx commented 7 years ago

This fixes the check when there are longer keys in the info section.

E.g. we've seen this:

$ sudo smartctl -i /dev/sda
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-72-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               HP
Product:              LOGICAL VOLUME
Revision:             6.00
User Capacity:        1,000,171,331,584 bytes [1.00 TB]
Logical block size:   512 bytes
Logical Unit id:      0x600508b1001cbf6277f0bc12edc01e5f
Serial number:        0014380263C4BD0
Device type:          disk
Local Time is:        Tue Jun 27 16:59:36 2017 UTC
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Disabled or Not Supported

Pull Request Checklist

Is this in reference to an existing issue?

General

New Plugins

Purpose

Known Compatibility Issues

majormoses commented 7 years ago

released: https://rubygems.org/gems/sensu-plugins-disk-checks/versions/2.3.0