About the agent lower layers handler function use distinguish between "Windows"

Started by x199x, November 07, 2011, 04:15:46 PM

Previous topic - Next topic

x199x

    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.

Victor Kirhenshtein

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