Merge pull request #218 from rabagliati/master

negative ipmi thermal margin
This commit is contained in:
Jordi Sanfeliu 2019-01-16 12:27:46 +01:00 committed by GitHub
commit 7f0fde037f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View File

@ -78,15 +78,15 @@ sub ipmi_init {
push(@last, "RRA:LAST:0.5:1440:" . (365 * $n)); push(@last, "RRA:LAST:0.5:1440:" . (365 * $n));
} }
for($n = 0; $n < scalar(my @sl = split(',', $ipmi->{list})); $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 . "_s1:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s2:GAUGE:120:0:U"); push(@tmp, "DS:ipmi" . $n . "_s2:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s3:GAUGE:120:0:U"); push(@tmp, "DS:ipmi" . $n . "_s3:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s4:GAUGE:120:0:U"); push(@tmp, "DS:ipmi" . $n . "_s4:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s5:GAUGE:120:0:U"); push(@tmp, "DS:ipmi" . $n . "_s5:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s6:GAUGE:120:0:U"); push(@tmp, "DS:ipmi" . $n . "_s6:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s7:GAUGE:120:0:U"); push(@tmp, "DS:ipmi" . $n . "_s7:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s8:GAUGE:120:0:U"); push(@tmp, "DS:ipmi" . $n . "_s8:GAUGE:120:U:U");
push(@tmp, "DS:ipmi" . $n . "_s9:GAUGE:120:0:U"); push(@tmp, "DS:ipmi" . $n . "_s9:GAUGE:120:U:U");
} }
eval { eval {
RRDs::create($rrd, RRDs::create($rrd,
@ -158,7 +158,7 @@ sub ipmi_update {
$str = trim($i); $str = trim($i);
$unit = $ipmi->{units}->{$e}; $unit = $ipmi->{units}->{$e};
foreach(@data) { foreach(@data) {
if(/^($str)\s+\|\s+(\d+\.*\d*)\s+$unit\s+/) { if(/^($str)\s+\|\s+(-?\d+\.*\d*)\s+$unit\s+/) {
my $val = $2; my $val = $2;
$sens[$e][$e2] = $val; $sens[$e][$e2] = $val;

View File

@ -21,6 +21,7 @@
use strict; use strict;
use warnings; use warnings;
use File::Basename;
use FindBin qw($Bin); use FindBin qw($Bin);
use lib $Bin . "/lib", "/usr/lib/monitorix"; use lib $Bin . "/lib", "/usr/lib/monitorix";
@ -236,7 +237,7 @@ sub graph_footer {
# MAIN # MAIN
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
open(IN, "< monitorix.conf.path"); open(IN, dirname(__FILE__)."/monitorix.conf.path");
my $config_path = <IN>; my $config_path = <IN>;
chomp($config_path); chomp($config_path);
close(IN); close(IN);