Ad Widget

Collapse

Agent 2 is not deleting files on Windows Server 2019.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nedfox
    Junior Member
    • Feb 2023
    • 2

    #1

    Agent 2 is not deleting files on Windows Server 2019.

    We have some triggers which keep an eye on logfile sizes. If a treshold is reached, the file is backupped and deleted.
    This works fine with Zabbix Agent on the same server. Zabbix Agent 2 fails.
    EnableRemoteCommands etc is set, and after upgrading to Zabbix 6 AllowKey=system.run[*]

    Zabbix Agent2, running on System Account, reports back: Success. However, the file is not deleted.
    Log:
    2023/02/15 15:26:18.078063 executed direct exporter task for key 'system.run[del "C:\Program Files\Zabbix Agent 2\zbx-winupdate.log"
    timeout /t 5,nowait]'
    2023/02/15 15:26:18.084986 received [{"response":"success","info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000084"}] from [x.x.x.50:10051]
    2023/02/15 15:26:18.084986 received [{"response":"success","info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000029"}] from [x.x.x.51:10051]
    2023/02/15 15:26:18.084986 sending passive check response: '1' to 'x.x.x.51'
    2023/02/15 15:26:18.309501 received passive check request: 'system.run[echo "X">"C:\Program Files\Zabbix Agent 2\zbx-winupdate.log",nowait]' from 'x.x.x.51'
    2023/02/15 15:26:18.309501 [1] processing update request (1 requests)

    ​Conf:
    AllowKey=system.run[*]

    Script: Zabbix Agent:
    del "C:\Program Files\Zabbix Agent 2\zbx-winupdate.log"
    timeout /t 5​

    -A script which executes taskkill is executed without problems.
    -System has full rights to the Zabbix Agent 2 folder
    -Running the service with a domain Admin account doesn't solve the issue

    What am I doing wrong?
    Starts
    15-02-2023
    Ends
    15-02-2023
Working...