[Fusioninventory-devel] /usr/sbin/system_profiler timeout on MacOSX

Guillaume Rousse guillomovitch at gmail.com
Wed Apr 3 07:58:01 UTC 2013


Le 03/04/2013 09:01, David Durieux a écrit :
>
> In MacOSX(agent 2.2.x), the function getSystemProfilerInfos() run
> command '/usr/sbin/system_profiler' and can make 2 or 3 minutes to
> complete get information. We must increase 'backend-collect-timeout' in
> agent config.
I'd rather not change a global defaut value for everyone just because 
you're facing the issue on a specific host. Is that true for all macos 
hosts, first ?

> Another problem is MacOSX run this command many time (one time for each
> CPU, Memory, storage and video) perhaps run only one time and store
> result in memory to parse it when modules require it can be a good idea?
All calls to the getSystemProfilerInfo() with the same parameters are 
already cached, thanks to memoize usage line 17 in 
FusionInventory::Agent::Tools::MacOs:
memoize('getSystemProfilerInfos');

According to grep, it is called either as:
getSystemProfilerInfo()
getSystemProfilerInfo(logger => $logger)
getSystemProfilerInfo(type => 'SPApplicationsDataType', logger => $logger)

Indeed, the first two ones should be merged, as this is strictly the 
same command invocation. However, the last one requires a different 
command execution, and can't be merged.
-- 
BOFH excuse #77:

Typo in the code



More information about the Fusioninventory-devel mailing list