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

Returns disk path instead of Disk Class instance reference #163

Closed VeselaHouba closed 3 years ago

VeselaHouba commented 4 years ago

Pull Request Checklist

Is this in reference to an existing issue?

General

New Plugins

Purpose

Check was returning class instance reference, which is quite useless.

Before:

bin/check-smart-status.rb --json /etc/sensu/conf.d/smart.json
SmartCheckStatus CRITICAL: #<Disk:0x0000561460428e28> critical 9 Power_On_Hours: 32813
#<Disk:0x0000561460428248> critical 5 Reallocated_Sector_Ct: 38648
#<Disk:0x0000561460428248> critical 9 Power_On_Hours: 34045
#<Disk:0x0000561460428248> critical 196 Reallocated_Event_Count: 4806
#<Disk:0x0000561460428248> critical 197 Current_Pending_Sector: 640
#<Disk:0x0000561460428248> critical 199 UDMA_CRC_Error_Count: 13
#<Disk:0x0000561460427730> critical 9 Power_On_Hours: 33277
#<Disk:0x0000561460426c40> critical 9 Power_On_Hours: 35113
#<Disk:0x0000561460426c40> critical 199 UDMA_CRC_Error_Count: 2
#<Disk:0x0000561460428e28> warning 194 Temperature_Celsius: 44
#<Disk:0x0000561460427730> warning 194 Temperature_Celsius: 42

After:

bin/check-smart-status.rb --json /etc/sensu/conf.d/smart.json
SmartCheckStatus CRITICAL: /dev/sda critical 9 Power_On_Hours: 32813
/dev/sdb critical 5 Reallocated_Sector_Ct: 38648
/dev/sdb critical 9 Power_On_Hours: 34045
/dev/sdb critical 196 Reallocated_Event_Count: 4806
/dev/sdb critical 197 Current_Pending_Sector: 640
/dev/sdb critical 199 UDMA_CRC_Error_Count: 13
/dev/sdc critical 9 Power_On_Hours: 33277
/dev/sdd critical 9 Power_On_Hours: 35112
/dev/sdd critical 199 UDMA_CRC_Error_Count: 2
/dev/sda warning 194 Temperature_Celsius: 44
/dev/sdb warning 194 Temperature_Celsius: 41
/dev/sdc warning 194 Temperature_Celsius: 42

Known Compatibility Issues