Bonjour à tous,
Ayant des serveurs sous windows, je dois toujours faire attention aux alertes Microsoft.
Pour monitorer le nombre de mise à jour en attente sur votre serveur, il faut :
1 ) Créer deux fichiers dans le repertoire "C:\Program Files\Zabbix Agent\"
ms-reboot.vbs
Set oSysInfo=CreateObject("Microsoft.Update.SystemInfo ")
Set oSearcher=CreateObject("Microsoft.Update.Searcher" )
Set oRes=oSearcher.Search("Type='Software' and IsInstalled=0")
WScript.Echo oSysInfo.RebootRequired
ms-update.vbs
Set oSysInfo=CreateObject("Microsoft.Update.SystemInfo ")
Set oSearcher=CreateObject("Microsoft.Update.Searcher" )
Set oRes=oSearcher.Search("Type='Software' and IsInstalled=0")
WScript.Echo oRes.Updates.Count
2 ) augmenter le timeout à 30 dans le fichier zabbix_agentd.conf
### Option: Timeout
# Spend no more than Timeout seconds on processing
Timeout=30
3 ) Rajouter les lignes :
UserParameter=ms-reboot,cscript //NoLogo "C:\Program Files\Zabbix Agent\ms-reboot.vbs"
UserParameter=ms-update,cscript //NoLogo "C:\Program Files\Zabbix Agent\ms-update.vbs"
4) relancer le service Zabbix Agent pour Windows
5)reste a tester :
[root@noc ~]# /opt/zabbix/bin/zabbix_get -s srvdc02 -k ms-reboot
0
[root@noc ~]# /opt/zabbix/bin/zabbix_get -s srvdc02 -k ms-update
7
Pour info le ms-reboot renvoi -1 lorsqu'il est en attente de redemarrage.
Cordialement,
Patrice
Ayant des serveurs sous windows, je dois toujours faire attention aux alertes Microsoft.
Pour monitorer le nombre de mise à jour en attente sur votre serveur, il faut :
1 ) Créer deux fichiers dans le repertoire "C:\Program Files\Zabbix Agent\"
ms-reboot.vbs
Set oSysInfo=CreateObject("Microsoft.Update.SystemInfo ")
Set oSearcher=CreateObject("Microsoft.Update.Searcher" )
Set oRes=oSearcher.Search("Type='Software' and IsInstalled=0")
WScript.Echo oSysInfo.RebootRequired
ms-update.vbs
Set oSysInfo=CreateObject("Microsoft.Update.SystemInfo ")
Set oSearcher=CreateObject("Microsoft.Update.Searcher" )
Set oRes=oSearcher.Search("Type='Software' and IsInstalled=0")
WScript.Echo oRes.Updates.Count
2 ) augmenter le timeout à 30 dans le fichier zabbix_agentd.conf
### Option: Timeout
# Spend no more than Timeout seconds on processing
Timeout=30
3 ) Rajouter les lignes :
UserParameter=ms-reboot,cscript //NoLogo "C:\Program Files\Zabbix Agent\ms-reboot.vbs"
UserParameter=ms-update,cscript //NoLogo "C:\Program Files\Zabbix Agent\ms-update.vbs"
4) relancer le service Zabbix Agent pour Windows
5)reste a tester :
[root@noc ~]# /opt/zabbix/bin/zabbix_get -s srvdc02 -k ms-reboot
0
[root@noc ~]# /opt/zabbix/bin/zabbix_get -s srvdc02 -k ms-update
7
Pour info le ms-reboot renvoi -1 lorsqu'il est en attente de redemarrage.
Cordialement,
Patrice
Comment