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
355c68ca79
commit
0fb5147332
|
@ -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>
|
||||
|
||||
* pandora_agent_daemon: Added support for OpenVZ/Virtuozzo.
|
||||
|
|
|
@ -1016,6 +1016,9 @@ sub load_procs () {
|
|||
my @procs = `$cmd`;
|
||||
return undef unless ($? eq 0);
|
||||
|
||||
# Clear past process infomation
|
||||
%Procs = ();
|
||||
|
||||
# Parse process information
|
||||
foreach my $proc (@procs) {
|
||||
|
||||
|
@ -1162,6 +1165,9 @@ sub module_cpuproc ($) {
|
|||
# Check module parameters
|
||||
return () unless ($module->{'params'} ne '');
|
||||
|
||||
# Data collection layer
|
||||
load_procs ();
|
||||
|
||||
return () unless defined ($Procs{$module->{'params'}}) and defined ($Procs{$module->{'params'}}{'cpu'});
|
||||
return ($Procs{$module->{'params'}}{'cpu'});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue