mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-24 09:57:09 +00:00
Correct values reporting when load is low
This commit is contained in:
parent
d9722c22e7
commit
4a6ab5550b
1 changed files with 9 additions and 17 deletions
|
@ -138,9 +138,9 @@ my @vals2 = split(/ /, $out2);
|
|||
my $tmp2_reqpsec=$vals2[11];
|
||||
my $tmp2_conpsec=$vals2[10];
|
||||
|
||||
my $conpersec=0;
|
||||
my $reqpcon=0;
|
||||
my $reqpsec=0;
|
||||
my $conpersec=0;
|
||||
if (defined $tmp2_conpsec && $tmp2_conpsec =~ /^[+-]?\d+$/ && $tmp2_conpsec > 0){
|
||||
$conpersec=$tmp2_conpsec-$tmp1_conpsec;
|
||||
}
|
||||
|
@ -149,21 +149,13 @@ if (defined $tmp2_reqpsec && $tmp2_reqpsec =~ /^[+-]?\d+$/ && $tmp2_reqpsec > 0
|
|||
}
|
||||
if ($conpersec > 0){
|
||||
$reqpcon=$reqpsec/$conpersec;
|
||||
} else {
|
||||
$a2=0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($a2 && $r2 && $w2 && $wa2){
|
||||
print "reqpsec.value $reqpsec\n";
|
||||
print "conpersec.value $conpersec\n";
|
||||
printf("reqpcon.value %.2f\n", $reqpcon);
|
||||
print "total.value $a2\n";
|
||||
print "reading.value $r2\n";
|
||||
print "writing.value $w2\n";
|
||||
print "waiting.value $wa2\n";
|
||||
} else {
|
||||
foreach (qw(reqpsec conpersec reqpcon total reading writing waiting)) {
|
||||
print "$_.value U\n";
|
||||
}
|
||||
}
|
||||
print "reqpsec.value $reqpsec\n";
|
||||
print "conpersec.value $conpersec\n";
|
||||
printf("reqpcon.value %.2f\n", $reqpcon);
|
||||
print "total.value $a2\n";
|
||||
print "reading.value $r2\n";
|
||||
print "writing.value $w2\n";
|
||||
print "waiting.value $wa2\n";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue