diff --git a/plugins/other/nginx-combined b/plugins/other/nginx-combined index 7ec7c18f..a8052a3c 100755 --- a/plugins/other/nginx-combined +++ b/plugins/other/nginx-combined @@ -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";