Ad Widget

Collapse

Read last Updateinfo via powershell fails on server 2019

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • piti87
    Junior Member
    • Jun 2020
    • 23

    #1

    Read last Updateinfo via powershell fails on server 2019



    Hello,
    I try to get the last Update-Date from the microsoft OS.
    On the server 2022-systems it works great.

    In Server 2019 it always failed with
    "Timeout while executing a shell script."

    I have already increased the timeout on agent and server to 30 seconds.

    Executed manual (cmd.exe) the foloowing command
    powershell.exe -nologo -command "((Get-Hotfix | Sort-Object -Property InstalledOn -Descending | Select-Object -First 1).InstalledOn)
    it takes

    3 seconds on the server 2022
    7 seconds on the server 2019


    Type: Zabbix agent
    Key: system.run[powershell.exe -nologo -command "((Get-Hotfix | Sort-Object -Property InstalledOn -Descending | Select-Object -First 1).InstalledOn)"]

    On the server 2019 in the agent log appears:
    4172:20231103:131522.992 Failed to execute command "powershell.exe -nologo -command "((Get-Hotfix | Sort-Object -Property InstalledOn -Descending | Select-Object -First 1).InstalledOn)"": Timeout while executing a shell script.

    Zabbix-Server: 6.0.21​​
    Zabbix-Agent: 6.0.23

    Any ideas how to solve that issue?

    Regards
Working...