2011-09-13 Koichiro Kikuchi <koichiro@rworks.jp>
* unix/pandora_agent: Clear the old process information before parsing current process information. Also added missing load_procs() call to module_cpuproc(). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4944 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
9f38bad0db
commit
532caca9eb
|
@ -1,3 +1,9 @@
|
||||||
|
2011-09-13 Koichiro Kikuchi <koichiro@rworks.jp>
|
||||||
|
|
||||||
|
* pandora_agent: Clear the old process information before
|
||||||
|
parsing current process information. Also added
|
||||||
|
missing load_procs() call to module_cpuproc().
|
||||||
|
|
||||||
2011-09-05 Koichiro Kikuchi <koichiro@rworks.jp>
|
2011-09-05 Koichiro Kikuchi <koichiro@rworks.jp>
|
||||||
|
|
||||||
* pandora_agent_daemon: Added support for OpenVZ/Virtuozzo.
|
* pandora_agent_daemon: Added support for OpenVZ/Virtuozzo.
|
||||||
|
|
|
@ -1016,6 +1016,9 @@ sub load_procs () {
|
||||||
my @procs = `$cmd`;
|
my @procs = `$cmd`;
|
||||||
return undef unless ($? eq 0);
|
return undef unless ($? eq 0);
|
||||||
|
|
||||||
|
# Clear past process infomation
|
||||||
|
%Procs = ();
|
||||||
|
|
||||||
# Parse process information
|
# Parse process information
|
||||||
foreach my $proc (@procs) {
|
foreach my $proc (@procs) {
|
||||||
|
|
||||||
|
@ -1162,6 +1165,9 @@ sub module_cpuproc ($) {
|
||||||
# Check module parameters
|
# Check module parameters
|
||||||
return () unless ($module->{'params'} ne '');
|
return () unless ($module->{'params'} ne '');
|
||||||
|
|
||||||
|
# Data collection layer
|
||||||
|
load_procs ();
|
||||||
|
|
||||||
return () unless defined ($Procs{$module->{'params'}}) and defined ($Procs{$module->{'params'}}{'cpu'});
|
return () unless defined ($Procs{$module->{'params'}}) and defined ($Procs{$module->{'params'}}{'cpu'});
|
||||||
return ($Procs{$module->{'params'}}{'cpu'});
|
return ($Procs{$module->{'params'}}{'cpu'});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue