Zabbix : Execute PowerShell Scripts to Check Windows Updates

Zabbix 5 Course : sbcode.net/zabbix/powershell-...
Course Coupons : sbcode.net/coupons
We can execute PowerShell commands on remote hosts with Zabbix agent.
In this lesson we will install 3 scripts, that we can use to query Windows Updates status on a remote windows host. Two of the scripts will be used as host items, and the other will be an administration script that we can call manually.
Note, If your scripts are slow running, you are likely to get timeouts when calling from Zabbix. You can set the timeout properties from the default 3 seconds to 1-30 seconds inside the Zabbix agents config, and also the Zabbix Proxy config if your agent is monitored by proxy.
Note, for Administration scripts that run on the agent, you will also need to edit the zabbix_agentd.conf. Set set EnableRemoteCommands = 1, and/or modify the DenyKey/AllowKey properties depending on your version of the Zabbix agent.
also, for Administration scripts, this will not work on agents connected to the Zabbix server as capable of Active checks only. Zabbix server will need to be able to do passive checks. So that means, a firewall rule, or Zabbix proxy setup on the same network as the agent, if the agent is not on the same network as the Zabbix Server.
0:00 Execute Windows PowerShell Scripts on remote Zabbix Agent
0:40 Download example powershell scripts to manage windows updates
1:20 Test downloaded scripts locally on server first
2:40 Discuss execution policy bypass
3:10 Setup scripts as Zabbix Userparameters
4:35 Restart Zabbix agent and create the 1st item in the Zabbix UI
7:10 Add the 2nd item in the Zabbix UI
6:50 Discuss timeouts and adjust configurations
9:05 Setup 3rd script as an Administration script
10:20 Test administration script
#zabbix
#zabbixPowershell
#zabbixUserparameters
#zabbixAdministrationScripts
#zabbixCourse
#zabbixTutorial

Пікірлер: 18

  • @someonenew5198
    @someonenew51983 жыл бұрын

    You're a gift for humanity sir!! Thank you!!

  • @Twikkilol
    @Twikkilol2 жыл бұрын

    Thank you man! I love Zabbix :-)

  • @mbertho
    @mbertho4 жыл бұрын

    Amazing, thanks!

  • @ferspider3
    @ferspider33 жыл бұрын

    Show! Muito explicativo! Foi de primeira!

  • @davidbarahona9636
    @davidbarahona96363 жыл бұрын

    gracias!! desde Chile

  • @adamw4323
    @adamw43234 жыл бұрын

    I have a problem, that my agent does not send any data from the script to the zabbix server . Any ideas?

  • @danielgalaz875
    @danielgalaz875 Жыл бұрын

    Hello, I have done everything, but when I run the item in zabbix, I get the following error: Get value from agent failed: ZBX_TCP_READ() timed out help

  • @woebenwoeben2545
    @woebenwoeben25454 жыл бұрын

    having -Get value from agent failed: SSL_read() timed out -Cannot execute script errors when i try to execute the script.

  • @sbcode

    @sbcode

    4 жыл бұрын

    does the script work when you run it from the bash prompt

  • @woebenwoeben2545

    @woebenwoeben2545

    4 жыл бұрын

    when i test the files local it works

  • @sbcode

    @sbcode

    4 жыл бұрын

    Your problem is something else to do with how your agent connects to the server.

  • @prodbykiv.3841
    @prodbykiv.38413 жыл бұрын

    Unsupported Item Key. Please help.

  • @sbcode

    @sbcode

    3 жыл бұрын

    sbcode.net/zabbix/powershell-windows-updates/#create-an-administration-script

  • @prodbykiv.3841

    @prodbykiv.3841

    3 жыл бұрын

    @@sbcode Do you mean there is a Problem with my Agent?

  • @adrianminunu6539
    @adrianminunu65395 ай бұрын

    script DaysSinceLastUpdate does not work anymore (goes error) after (ironically) latest updates

  • @sbcode

    @sbcode

    5 ай бұрын

    I just executed it locally and it works. Making it work in Zabbix is a little tricky, you probably just missed something.

  • @adrianminunu6539

    @adrianminunu6539

    5 ай бұрын

    @@sbcodescript was working OK for 6 months until last week, my platform is Windows Server 2016/19

  • @sbcode

    @sbcode

    5 ай бұрын

    Does it fail on all your servers? Perhaps it's timing out. Check the event logs. If you come up with a solution then post it here for other people haveing the same issue as you.