1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

Correct values reporting when load is low

This commit is contained in:
Ilya Ivanov 2010-12-02 14:01:32 +01:00 committed by Steve Schnepp
parent d9722c22e7
commit 4a6ab5550b

View file

@ -138,9 +138,9 @@ my @vals2 = split(/ /, $out2);
my $tmp2_reqpsec=$vals2[11]; my $tmp2_reqpsec=$vals2[11];
my $tmp2_conpsec=$vals2[10]; my $tmp2_conpsec=$vals2[10];
my $conpersec=0;
my $reqpcon=0; my $reqpcon=0;
my $reqpsec=0; my $reqpsec=0;
my $conpersec=0;
if (defined $tmp2_conpsec && $tmp2_conpsec =~ /^[+-]?\d+$/ && $tmp2_conpsec > 0){ if (defined $tmp2_conpsec && $tmp2_conpsec =~ /^[+-]?\d+$/ && $tmp2_conpsec > 0){
$conpersec=$tmp2_conpsec-$tmp1_conpsec; $conpersec=$tmp2_conpsec-$tmp1_conpsec;
} }
@ -149,21 +149,13 @@ if (defined $tmp2_reqpsec && $tmp2_reqpsec =~ /^[+-]?\d+$/ && $tmp2_reqpsec > 0
} }
if ($conpersec > 0){ if ($conpersec > 0){
$reqpcon=$reqpsec/$conpersec; $reqpcon=$reqpsec/$conpersec;
} else { }
$a2=0;
}
if ($a2 && $r2 && $w2 && $wa2){ print "reqpsec.value $reqpsec\n";
print "reqpsec.value $reqpsec\n"; print "conpersec.value $conpersec\n";
print "conpersec.value $conpersec\n"; printf("reqpcon.value %.2f\n", $reqpcon);
printf("reqpcon.value %.2f\n", $reqpcon); print "total.value $a2\n";
print "total.value $a2\n"; print "reading.value $r2\n";
print "reading.value $r2\n"; print "writing.value $w2\n";
print "writing.value $w2\n"; print "waiting.value $wa2\n";
print "waiting.value $wa2\n";
} else {
foreach (qw(reqpsec conpersec reqpcon total reading writing waiting)) {
print "$_.value U\n";
}
}