NetXMS Support Forum

Development => General => Topic started by: x199x on November 07, 2011, 04:15:46 PM

Title: About the agent lower layers handler function use distinguish between "Windows"
Post by: x199x on November 07, 2011, 04:15:46 PM
    In agent's spurce code : When you use the "nxget" tool to get agent's parameters, The agent finally call the "getParameter()" function.and finally it call " m_pParamList.handler(pszParam, m_pParamList.arg, pszValue) " .
    my question is : It do that workflow in both Windows and Linux platform. But it must have a "switch" to distinguish the OS platform,because the handler function(such as: H_DiskInfo  H_ProcessCount ) in different OS platform is different. Can you tell me where is the "switch" I can find it in src.
Title: Re: About the agent lower layers handler function use distinguish between "Windows"
Post by: Victor Kirhenshtein on November 07, 2011, 06:48:09 PM
Hi!

Agent is modular, and platform-specific parameters are provided by subagents. When agent starts, it automatically loads so-called "platform subagent", which provides these parameters. For example, on Windows agent will load "winnt.nsm", and on Linux it will load "libnsm_linux.so". After subagent loading, parameters provided it added to m_ParamList in core agent. You may take a look inside subagent.cpp if you are interested how subagents are loaded.

Best regards,
Victor
Title: Re: About the agent lower layers handler function use distinguish between "Windows"
Post by: x199x on November 08, 2011, 02:49:37 AM
Thanks a lot ;)