From ea82cfd825b50211a061826d7acc9479e4369656 Mon Sep 17 00:00:00 2001 From: Andy Rabagliati Date: Wed, 16 Jan 2019 10:21:22 +0200 Subject: [PATCH] allow negative thermal margin values in ipmi --- lib/ipmi.pm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/ipmi.pm b/lib/ipmi.pm index 3303d63..031bb1a 100644 --- a/lib/ipmi.pm +++ b/lib/ipmi.pm @@ -78,15 +78,15 @@ sub ipmi_init { push(@last, "RRA:LAST:0.5:1440:" . (365 * $n)); } for($n = 0; $n < scalar(my @sl = split(',', $ipmi->{list})); $n++) { - push(@tmp, "DS:ipmi" . $n . "_s1:GAUGE:120:0:U"); - push(@tmp, "DS:ipmi" . $n . "_s2:GAUGE:120:0:U"); - push(@tmp, "DS:ipmi" . $n . "_s3:GAUGE:120:0:U"); - push(@tmp, "DS:ipmi" . $n . "_s4:GAUGE:120:0:U"); - push(@tmp, "DS:ipmi" . $n . "_s5:GAUGE:120:0:U"); - push(@tmp, "DS:ipmi" . $n . "_s6:GAUGE:120:0:U"); - push(@tmp, "DS:ipmi" . $n . "_s7:GAUGE:120:0:U"); - push(@tmp, "DS:ipmi" . $n . "_s8:GAUGE:120:0:U"); - push(@tmp, "DS:ipmi" . $n . "_s9:GAUGE:120:0:U"); + push(@tmp, "DS:ipmi" . $n . "_s1:GAUGE:120:U:U"); + push(@tmp, "DS:ipmi" . $n . "_s2:GAUGE:120:U:U"); + push(@tmp, "DS:ipmi" . $n . "_s3:GAUGE:120:U:U"); + push(@tmp, "DS:ipmi" . $n . "_s4:GAUGE:120:U:U"); + push(@tmp, "DS:ipmi" . $n . "_s5:GAUGE:120:U:U"); + push(@tmp, "DS:ipmi" . $n . "_s6:GAUGE:120:U:U"); + push(@tmp, "DS:ipmi" . $n . "_s7:GAUGE:120:U:U"); + push(@tmp, "DS:ipmi" . $n . "_s8:GAUGE:120:U:U"); + push(@tmp, "DS:ipmi" . $n . "_s9:GAUGE:120:U:U"); } eval { RRDs::create($rrd, @@ -158,7 +158,7 @@ sub ipmi_update { $str = trim($i); $unit = $ipmi->{units}->{$e}; foreach(@data) { - if(/^($str)\s+\|\s+(\d+\.*\d*)\s+$unit\s+/) { + if(/^($str)\s+\|\s+(-?\d+\.*\d*)\s+$unit\s+/) { my $val = $2; $sens[$e][$e2] = $val;