Ad Widget

Collapse

Update UserParameter that echoes environmental variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zninteau
    Junior Member
    • Oct 2017
    • 2

    #1

    Update UserParameter that echoes environmental variable

    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.
  • zninteau
    Junior Member
    • Oct 2017
    • 2

    #2
    The fix for this was to instead use zabbix trapper, and have the script that calculates the variable on the server push the variable to the zabbix server using zabbix_sender + a trapper on zabbix.

    Comment

    Working...