vint21h / nagios-check-hddtemp

Check HDD temperature Nagios plugin
https://github.com/vint21h/nagios-check-hddtemp
GNU General Public License v3.0
9 stars 5 forks source link

Add critical and warning thresholds to performance data #4

Open BlackZork opened 3 years ago

BlackZork commented 3 years ago

It would be great if this plugin could output critical and warning thresholds in performance data string.

Without it I am unable to show critical and warning lines in grafana, when chart is fed with data from icinga2 plugin.

vint21h commented 3 years ago

Hello, sorry about the long time answer, but all that time I think about how that can look, please provide some examples, because I don't have a small clue how to provide that info without ruin existing return info.

taam commented 3 years ago

That should indeed be added. Here's some description regarding the format: https://nagios-plugins.org/doc/guidelines.html#AEN200

Please note that these thresholds can also be ranges (if supported), see #5.

taam commented 3 years ago

Side note: New Icinga 2 versions (since 2.13) support additional units of measurement, among others "degrees Celsius": https://icinga.com/docs/icinga-2/snapshot/doc/05-service-monitoring/#unit-of-measurement-uom

vint21h commented 3 years ago

Hi, if I understand right, for a call like that:

check_hddtemp.py -s 127.0.0.1 -p 7634 -P -w 50 -c 60

output must be:

CRITICAL: device /dev/sdb temperature 69C exceeds critical temperature threshold 60C, device /dev/sda is functional and stable 27C | /dev/sdb=69C;50;60 /dev/sda=27C;50;60\n

or with thresholds ranges support:

check_hddtemp.py -s 127.0.0.1 -p 7634 -P -w ~:50 -c ~:60
CRITICAL: device /dev/sdb temperature 69C exceeds critical temperature threshold 60C, device /dev/sda is functional and stable 27C | /dev/sdb=69C;~:50;~:60 /dev/sda=27C;~:50;~:60\n
taam commented 3 years ago

That looks correct to me, I just don't know if all (relevant) performance data consumers can handle this. (Luckily for disk temperatures changing the default warning/critical min value from -∞ to 0 would probably be fine.)