fixed a bug in 'squid.pm' module that prevented from seeing values in the network protocols usage graph

This commit is contained in:
Jordi Sanfeliu 2014-10-16 13:08:50 +02:00
parent db8c630b9a
commit ffc8934e83
2 changed files with 6 additions and 4 deletions

View File

@ -29,6 +29,8 @@
correctly the opened connections either in IPv4 and IPv6. [#66]
- Fixed a missing CDEF that prevented creating the 'process05z.png' graph when
the option 'show_gaps' was enabled. [#70]
- Fixed a bug in 'squid.pm' module that prevented from seeing values in the
network protocols usage graph.
- Small cosmetic changes.

View File

@ -390,25 +390,25 @@ sub squid_update {
close(IN);
$all = join('', @data);
$all =~ s/\n/ /g;
($value) = ($all =~ m/ HTTP I\/O number of reads.*?(\d+)/g) || 0;
($value) = ($all =~ m/ HTTP I\/O number of reads.*?(\d+)/g)[0] || 0;
chomp($value);
$io_http = $value - ($config->{squid_hist}->{'io_http'} || 0);
$io_http = 0 unless $io_http != $value;
$io_http /= 60;
$config->{squid_hist}->{'io_http'} = $value;
($value) = ($all =~ m/ FTP I\/O number of reads.*?(\d+)/g) || 0;
($value) = ($all =~ m/ FTP I\/O number of reads.*?(\d+)/g)[0] || 0;
chomp($value);
$io_ftp = $value - ($config->{squid_hist}->{'io_ftp'} || 0);
$io_ftp = 0 unless $io_ftp != $value;
$io_ftp /= 60;
$config->{squid_hist}->{'io_ftp'} = $value;
($value) = ($all =~ m/ Gopher I\/O number of reads.*?(\d+)/g) || 0;
($value) = ($all =~ m/ Gopher I\/O number of reads.*?(\d+)/g)[0] || 0;
chomp($value);
$io_gopher = $value - ($config->{squid_hist}->{'io_gopher'} || 0);
$io_gopher = 0 unless $io_gopher != $value;
$io_gopher /= 60;
$config->{squid_hist}->{'io_gopher'} = $value;
($value) = ($all =~ m/ WAIS I\/O number of reads.*?(\d+)/g) || 0;
($value) = ($all =~ m/ WAIS I\/O number of reads.*?(\d+)/g)[0] || 0;
$value = 0 unless defined($value);
chomp($value);
$io_wais = $value - ($config->{squid_hist}->{'io_wais'} || 0);