Environment variables in nxagentd.conf on windows?

Started by Dani@M3T, April 02, 2014, 01:52:25 PM

Previous topic - Next topic

Dani@M3T

Is there a possibility to use windows environment variables in nxagentd.conf on windows nodes? So we could use one config-file for all windows nodes (32bit oder 64bit, English or different language). Especially %ProgramFiles% would be usefull.

Victor Kirhenshtein

No, it's not possible. I'll add it as change request though.

Best regards,
Victor

Dani@M3T

thanks for clarification and putting it on the list.

Dani@M3T


Victor Kirhenshtein

Seems that it was forgotten. I've scheduled it for 1.2.17 release.

Best regards,
Victor

Dani@M3T

After update to NetXMS V1.2.17 I tested the new feature to use environment variables in agent config for windows agents.
So I replaced in Agent Config Manager "C:\Program Files" thrue "%ProgramFiles%". Than I restarted the agent on a Win2012R2 node. The local 'nxagnetd.conf'-File was updated and contains now "%ProgramFiles%". But the agent doesn't start after that.

Victor Kirhenshtein

Hi,

you should use ${} (UNIX-like) for environment variable expansion in configs. I've choose that form because you may need to pass % sign to underlying layer (for example, it is often used in names of performance counters), and then you'll have to escape all % that are already there in configs. So, ${ProgramFiles} should work.

Best regards,
Victor

Dani@M3T

Thanks Victor. I can confirm it's working like this. So I only need one AgentConfig for all kind of Windows agents! (language, 32bit, 64bit)