Hello!
I am using a rather complicated and long-running powershell script to set an environmental variable.
Zabbix Agent uses a simple echo command to echo this variable.
This works flawlessly. Once. When Zabbix starts up it successfully grabs the latest data from the environmental variable.
On every subsequent query against this command, it grabs the exact same data. If I restart the zabbix agent service, it grabs the new data. My assumption is that zabbix_agent uses the same cmd session for everything. Cmd only refreshes the environmental variables on open, not when read.
.bat has no way to refresh environmental variables without third party plugins (I'm not really trying to install anything else).
Is there any workaround for this, such as forcing zabbix to open a new session?
Also, using system.run[<echo command to get the global variable>] has the exact same problem.
I am using a rather complicated and long-running powershell script to set an environmental variable.
Zabbix Agent uses a simple echo command to echo this variable.
This works flawlessly. Once. When Zabbix starts up it successfully grabs the latest data from the environmental variable.
On every subsequent query against this command, it grabs the exact same data. If I restart the zabbix agent service, it grabs the new data. My assumption is that zabbix_agent uses the same cmd session for everything. Cmd only refreshes the environmental variables on open, not when read.
.bat has no way to refresh environmental variables without third party plugins (I'm not really trying to install anything else).
Is there any workaround for this, such as forcing zabbix to open a new session?
Also, using system.run[<echo command to get the global variable>] has the exact same problem.
Comment