Ad Widget

Collapse

problem with zabbix agent 2 and system.run on 2 DCs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • serpentes
    Junior Member
    • Jul 2023
    • 4

    #1

    problem with zabbix agent 2 and system.run on 2 DCs

    Hi there,

    I'm trying to execute a .ps1 script on several Windows machines via zabbix agent2 and system.run.

    Code:
    system.run[powershell.exe -NoProfile -ExecutionPolicy Bypass -file "%programfiles%\Zabbix Agent 2\scripts\script.ps1",nowait]
    on 10 out of 12 machines this works perfect. Only on 2 of my DCs it doesn't and I get the following error in the agent's log file:

    Code:
    2023/07/21 16:49:06.126559 check 'system.run[powershell.exe -NoProfile -ExecutionPolicy Bypass -file "%programfiles%\Zabbix Agent 2\scripts\script.ps1",nowait]' is not supported: Cannot find path to cmd.exe command: exec: "cmd.exe": cannot run executable found relative to current directory
    Any Ideas?

    thx,

    Serpentes
  • serpentes
    Junior Member
    • Jul 2023
    • 4

    #2
    to give an update:

    I found the issue

    for those who stumble upon the same problem here's my solution:

    When I installed the Zabbix Agent on those machines, I obviously forgot to check the "add Zabbix agent install location to PATH variable" checkmark. After I reinstalled the Agents and checked the checkmark, everything works as expected.

    Greetings,

    Serpentes​

    Comment

    Working...