From e2fd82d77a1251143bcefdfe3dcfe1e35bbfbedc Mon Sep 17 00:00:00 2001 From: Air Date: Fri, 15 Nov 2019 23:49:46 +0900 Subject: [PATCH] add temperature support --- plugins/disk/nvme | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/disk/nvme b/plugins/disk/nvme index 0caa80db..7bb7cb28 100755 --- a/plugins/disk/nvme +++ b/plugins/disk/nvme @@ -95,6 +95,7 @@ None known. Kjetil Torgrim Homme Andreas Perhab, WT-IO-IT GmbH +Temperature support by Air =head1 LICENSE @@ -347,6 +348,20 @@ $_.max 100 EOF my_print_thresholds($_, 'nvme_spare', $device, '10:', '3:'); } + print <<'EOF'; +multigraph nvme_temperature +graph_title NVME Temperature +graph_order $sn_list +graph_vlabel Temperature +graph_category disk +graph_info Temperature +EOF + for (@sn) { + print <<"EOF"; +$_.label $list->{$_}->{device} temperature +$_.type GAUGE +EOF + } } else { for (@sn) { $list->{$_}->{smart} = smart_log($list->{$_}->{device}); @@ -382,4 +397,11 @@ EOF $spare =~ s/%//; print "$_.value $spare\n"; } + print "multigraph nvme_temperature\n"; + for (@sn) { + my $info = $list->{$_}; + my $temperature = $info->{smart}->{temperature}; + $temperature =~ s/^(\d+).*/$1/; + print "$_.value $temperature\n"; + } }