mirror of https://github.com/mikaku/Monitorix.git
Changed the source from where the memory usage is collected in the 'squid' graph
This commit is contained in:
parent
f93c2b5afd
commit
1c9cc26e8e
2
Changes
2
Changes
|
@ -1,5 +1,7 @@
|
|||
3.N.N - NN.XXX-2013
|
||||
====================
|
||||
- Changed the source from where the memory usage is collected in the 'squid'
|
||||
graph. Now the values shown are more real and accurate.
|
||||
- Fixed a bug that prevented seeing the Core temperatures in the 'lmsens' graph.
|
||||
(thanks to Bryan Guidroz, bryanguidroz AT hotmail.com for pointing this out)
|
||||
|
||||
|
|
24
lib/squid.pm
24
lib/squid.pm
|
@ -303,13 +303,25 @@ sub squid_update {
|
|||
close(IN);
|
||||
$rrdata .= ":$rq_client_http_req:$rq_client_http_hit:$rq_server_http_req:$rq_server_ftp_req:$rq_server_other_req:$rq_aborted_req:$rq_swap_files_cleaned:$rq_unlink_requests:0";
|
||||
|
||||
open(IN, "$squid->{cmd} mgr:mem |");
|
||||
open(IN, "$squid->{cmd} mgr:info |");
|
||||
my $memory_section = 0;
|
||||
while(<IN>) {
|
||||
if(/^Total /) {
|
||||
(undef, undef, $m_alloc, undef, undef, undef, undef, $m_inuse) = split(' ', $_);
|
||||
chomp($m_alloc);
|
||||
chomp($m_inuse);
|
||||
last;
|
||||
if(/^Memory usage for squid via mallinfo/) {
|
||||
$memory_section = 1;
|
||||
next;
|
||||
}
|
||||
if($memory_section) {
|
||||
if(/^\tTotal in use:\s+(\d+) KB/) {
|
||||
$m_inuse = $1;
|
||||
chomp($m_inuse);
|
||||
next;
|
||||
}
|
||||
if(/^\tTotal size:\s+(\d+) KB/) {
|
||||
$m_alloc = $1;
|
||||
chomp($m_alloc);
|
||||
$memory_section = 0;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(IN);
|
||||
|
|
Loading…
Reference in New Issue