mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-27 11:24:42 +00:00
removed a bug caused by overloading
This commit is contained in:
parent
4d599e70cb
commit
16e9af8987
1 changed files with 9 additions and 5 deletions
|
@ -12,7 +12,7 @@
|
||||||
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
|
# Configuration parameters for /etc/munin/plugin-conf.d/munin-node
|
||||||
#
|
#
|
||||||
# [ipmi_therm]
|
# [ipmi_therm]
|
||||||
# user - User that has permissions to run the omreport binary
|
# user - User that has permissions to run ipmi-sensors
|
||||||
# env.category sensors
|
# env.category sensors
|
||||||
#
|
#
|
||||||
# Parameters:
|
# Parameters:
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
#
|
#
|
||||||
# Author: Alexx Roche <munin-ipmi-plugin@alexx.net>
|
# Author: Alexx Roche <munin-ipmi-plugin@alexx.net>
|
||||||
# Built on the work of Justin Shepherd <galstrom21@gmail.com>
|
# Built on the work of Justin Shepherd <galstrom21@gmail.com>
|
||||||
# Revision: 1.0 2010/01/28
|
# Revision: 1.2 2010/10/15
|
||||||
#
|
#
|
||||||
#%# family=auto
|
#%# family=auto
|
||||||
#%# capabilities=autoconf
|
#%# capabilities=autoconf
|
||||||
|
@ -50,8 +50,9 @@ if ($ARGV[0] && $ARGV[0] eq "autoconf"){
|
||||||
my @result = `$cmd`;
|
my @result = `$cmd`;
|
||||||
my (%val, $index);
|
my (%val, $index);
|
||||||
$index=0;
|
$index=0;
|
||||||
|
my $count=0;
|
||||||
#Four of these seem to be unlabled, I'm going to guess that they are the CPU(s) and HDD(s)
|
#Four of these seem to be unlabled, I'm going to guess that they are the CPU(s) and HDD(s)
|
||||||
my @unknown = ('HDD0','HDD1','CPU0','CPU1');
|
my @unknown = ('CPU0','CPU1','HDD0','HDD1');
|
||||||
foreach my $line (@result) {
|
foreach my $line (@result) {
|
||||||
$line =~ s/\s+/ /g;
|
$line =~ s/\s+/ /g;
|
||||||
$line =~ s/\s$//g;
|
$line =~ s/\s$//g;
|
||||||
|
@ -61,16 +62,19 @@ if ($ARGV[0] && $ARGV[0] eq "autoconf"){
|
||||||
if($field=~m/^(Temp|Ambient|Planar|Riser)/) {
|
if($field=~m/^(Temp|Ambient|Planar|Riser)/) {
|
||||||
my $f=$1;
|
my $f=$1;
|
||||||
if($f eq 'Temp'){
|
if($f eq 'Temp'){
|
||||||
$f = $unknown[$index];
|
$f = $unknown[$count];
|
||||||
|
$count++;
|
||||||
}
|
}
|
||||||
my @data = split / /, $value;
|
my @data = split / /, $value;
|
||||||
$data[2]=~s/^\(//;
|
$data[2]=~s/^\(//;
|
||||||
$data[2]=~s/\)$//;
|
$data[2]=~s/\)$//;
|
||||||
if($f){
|
if($f){
|
||||||
my($warn,$crit) = split/\//, $data[2];
|
my($warn,$crit) = split/\//, $data[2];
|
||||||
|
unless($warn=~m/\d+/){ $warn = 0; }
|
||||||
|
unless($crit=~m/\d+/){ $crit = 200; }
|
||||||
$val{$index}{'Probe Name'} = "$f";
|
$val{$index}{'Probe Name'} = "$f";
|
||||||
$val{$index}{'Reading'} = "$data[0]";
|
$val{$index}{'Reading'} = "$data[0]";
|
||||||
$val{$index}{'Warning Threshold'} = "$warn";
|
$val{$index}{'Warning Threshold'} = ($crit - $warn);
|
||||||
$val{$index}{'Critical Threshold'} = "$crit";
|
$val{$index}{'Critical Threshold'} = "$crit";
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue