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

metrics-disk-capacity doesn't parse device names correctly #105

Closed nmollerup closed 5 years ago

nmollerup commented 5 years ago

Output from v 3.1.0 of metrics-disk-capacity.rb:

theia041.disk.sc.used 5858892 1545055267
theia041.disk.sc.avail 15102388 1545055267
theia041.disk.sc.capacity 28 1545055267
theia041.disk.s.used 454056 1545055267
theia041.disk.s.avail 16312920 1545055267
theia041.disk.s.capacity 3 1545055267
theia041.disk.sa2.used 339280 1545055267
theia041.disk.sa2.avail 125528 1545055267
theia041.disk.sa2.capacity 73 1545055267
theia041.disk.s.used 550448 1545055267
theia041.disk.s.avail 16216528 1545055267
theia041.disk.s.capacity 4 1545055267
theia041.disk.sa1.used 3406 1545055267
theia041.disk.sa1.avail 57074 1545055267
theia041.disk.sa1.capacity 6 1545055267

Expected output:

theia041.disk.sdc.used 5858892 1545055352
theia041.disk.sdc.avail 15102388 1545055352
theia041.disk.sdc.capacity 28% 1545055352
theia041.disk.sdd.used 454056 1545055352
theia041.disk.sdd.avail 16312920 1545055352
theia041.disk.sdd.capacity 3% 1545055352
theia041.disk.sda2.used 339280 1545055352
theia041.disk.sda2.avail 125528 1545055352
theia041.disk.sda2.capacity 73% 1545055352
theia041.disk.sde.used 551432 1545055352
theia041.disk.sde.avail 16215544 1545055352
theia041.disk.sde.capacity 4% 1545055352
theia041.disk.sda1.used 3406 1545055352
theia041.disk.sda1.avail 57074 1545055352
theia041.disk.sda1.capacity 6% 1545055352

Found that it is caused by an incorrect substitution in the code on line 71 and 98.

majormoses commented 5 years ago

fixed #106 released: https://rubygems.org/gems/sensu-plugins-disk-checks/versions/3.1.1