Ad Widget

Collapse

Monitoring available Windows updates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • RohrbaGe
    Senior Member
    • Aug 2005
    • 167

    #16
    Where can I get tje latest version of the script.
    It sounds very interesting for me.
    Will it work also with a WUS server?


    ro

    Comment

    • eger
      Member
      • Nov 2006
      • 95

      #17
      Originally posted by RohrbaGe
      Where can I get tje latest version of the script.
      It sounds very interesting for me.
      Will it work also with a WUS server?


      ro
      See the first page of this thread. It explains how to set it up.

      Comment

      • eger
        Member
        • Nov 2006
        • 95

        #18
        Originally posted by tiggs
        Ok, so I ran the trapper commands manually and input some test data and it's definitely making it to the Zabbix server without issue, so your script isn't the problem. It's just not updating on the web interface. See below.
        Try changing the item from Numeric to Text/Character and see if there is a difference. I would post a new thread for troubleshooting the Zabbix trapper.

        Comment

        • alixen
          Senior Member
          • Apr 2006
          • 474

          #19
          Originally posted by tiggs
          Ok, so I ran the trapper commands manually and input some test data and it's definitely making it to the Zabbix server without issue
          Not really.
          In your screenshot, zabbix_sender return is:
          Code:
          Processed 0 [B]Failed 1[/B]
          so you should check again communication between zabbix_sender and Zabbix server.

          Regards,
          Alixen
          http://www.alixen.fr/zabbix.html

          Comment

          • tiggs
            Junior Member
            • Jul 2010
            • 8

            #20
            I can't believe I didn't notice that I ran the command again with the same result (screenshots below). After looking at the command again, I realized what was wrong. I'm using a proxy for this host and was trying to communicate directly with the zabbix server instead of the proxy. I changed the -z option to the proxy server and all is working well now. Hopefully, my headache will help the next person that tries to configure this with a proxy in the middle. Thanks everyone for your help!
            Attached Files

            Comment

            • beeloo
              Member
              • Nov 2010
              • 62

              #21
              Thanks for posting this useful script. However, I have a little trouble to get this script to work. I was tried to testing this script from my windows 7 machine. The agent already installed and I could see the GREEN "Z" enabled in Zabbix server. I think the communication between the Zabbix server and Windows 7 are good.

              Here is the script in my windows 7 machine:


              serverName = "10.72.x.x"
              hostName = "w7"
              zbxSender = "C:\Program Files\Zabbix Agent\zabbix_sender.exe"

              updatesHigh = 0
              updatesOptional = 0

              Set objSearcher = CreateObject("Microsoft.Update.Searcher")
              Set objSysInfo = CreateObject("Microsoft.Update.SystemInfo")
              Set objResults = objSearcher.Search("IsInstalled=0")
              Set colUpdates = objResults.Updates
              Set WSHShell = CreateObject("WScript.Shell")

              For i = 0 to colUpdates.Count - 1

              If (colUpdates.Item(i).IsInstalled = False AND colUpdates.Item(i).AutoSelectOnWebSites = False) Then
              updatesOptional = updatesOptional + 1
              ElseIf (colUpdates.Item(i).IsInstalled = False AND colUpdates.Item(i).AutoSelectOnWebSites = True) Then
              updatesHigh = updatesHigh + 1
              End IF

              Next

              updatesTotal = (updatesHigh + updatesOptional)

              WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[total] -o " & updatesTotal
              WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[high] -o " & updatesHigh
              WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[optional] -o " & updatesOptional
              WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[reboot] -o " & objSysInfo.RebootRequired

              WScript.Quit 0


              I tried to run this script manually from Windows 7 and I received below error:

              C:\zabbix\wu>cscript //Job:winupdate.ksh
              Input Error: There is no script file specified.


              Not sure what went wrong.

              Please advise.

              Thanks in advance.

              Beeloo

              Comment

              • beeloo
                Member
                • Nov 2010
                • 62

                #22
                After I changed the extension from winupdate.ksh to winupdate.vbs. I don't received any error when I run it manually.

                C:\zabbix\wu>cscript winupdate.vbs

                C:\zabbix\wu>

                However, the Zabbix still not show up anything

                Here is I attached screenshot of one of the item configuration. If it works it should show up in the "OS" container. But it doesn't. Please advise. Thanks.
                Attached Files

                Comment

                • eger
                  Member
                  • Nov 2006
                  • 95

                  #23
                  Is the location of zabbix_sender.exe correct?

                  Try running the command manually from the command line and see what the output is:

                  zabbix_sender.exe -z 10.x.x.x -s w7 -k win_updates[total] -o 5

                  This should send a '5' to the win_updates[total] key and should show up in the latest data. But the output should say if it is successful or if it failed.

                  Comment

                  • beeloo
                    Member
                    • Nov 2010
                    • 62

                    #24
                    Thanks for the reply. Here is the output.. Doesn't look good. I make sure the "zabbix_sender.exe" location is correct as well.

                    C:\zabbix\win32>zabbix_sender.exe -vv -z 10.72.x.x -s w7 -k win_updates[total] -o 5
                    zabbix_sender.exe [2776]: DEBUG: Answer [{
                    "response":"success",
                    "info":"Processed 0 Failed 1 Total 1 Seconds spent 0.000034"}]
                    Info from server: "Processed 0 Failed 1 Total 1 Seconds spent 0.000034"
                    sent: 1; skipped: 0; total: 1

                    By the way, I'm running version 1.8.4, no proxy setup. Just the Zabbix Server itself.
                    Last edited by beeloo; 10-02-2011, 20:27.

                    Comment

                    • beeloo
                      Member
                      • Nov 2010
                      • 62

                      #25
                      As you see, I also change the "zabbix_sender.exe" location in the script.

                      Here is one:

                      serverName = "10.72.x.x"
                      hostName = "w7"
                      zbxSender = "C:\zabbix\win32\zabbix_sender.exe"

                      updatesHigh = 0
                      updatesOptional = 0

                      Set objSearcher = CreateObject("Microsoft.Update.Searcher")
                      Set objSysInfo = CreateObject("Microsoft.Update.SystemInfo")
                      Set objResults = objSearcher.Search("IsInstalled=0")
                      Set colUpdates = objResults.Updates
                      Set WSHShell = CreateObject("WScript.Shell")

                      For i = 0 to colUpdates.Count - 1

                      If (colUpdates.Item(i).IsInstalled = False AND colUpdates.Item(i).AutoSelectOnWebSites = False) Then
                      updatesOptional = updatesOptional + 1
                      ElseIf (colUpdates.Item(i).IsInstalled = False AND colUpdates.Item(i).AutoSelectOnWebSites = True) Then
                      updatesHigh = updatesHigh + 1
                      End IF

                      Next

                      updatesTotal = (updatesHigh + updatesOptional)

                      WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[total] -o " & updatesTotal
                      WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[high] -o " & updatesHigh
                      WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[optional] -o " & updatesOptional
                      WSHShell.Exec zbxSender & " -z " & serverName & " -s " & hostName & " -k win_updates[reboot] -o " & objSysInfo.RebootRequired

                      WScript.Quit 0

                      Comment

                      • beeloo
                        Member
                        • Nov 2010
                        • 62

                        #26
                        I'm not sure why I can't run the winupdate.ksh script in my windows 7 machine. But when I changed it to winupdate.vbs, it seems working but I don't see any thing from the zabbix_server.log...

                        Comment

                        • eger
                          Member
                          • Nov 2006
                          • 95

                          #27
                          Yep, it is not the script that is the problem. It is happening down the link in zabbix_sender to the zabbix server. You can see it failed:

                          Info from server: "Processed 0 Failed 1

                          So we need to solve this part.

                          Is there anything showing in the zabbix server log when you run the command manually?

                          Also, what is the version of zabbix_sender.exe? Make sure it is the same as server.

                          Comment

                          • beeloo
                            Member
                            • Nov 2010
                            • 62

                            #28
                            I don't see anything show in the zabbix_server.log.

                            I assume the zabbix_sender.exe is the latest version as I just download it from zabbix.com. Anyway, how can I check it?

                            Please advise.

                            Comment

                            • beeloo
                              Member
                              • Nov 2010
                              • 62

                              #29
                              The strange thing is, the windows agent seems communicate to zabbix server fine because I can see other datas pulled from the windows 7 machine (it belongs to the "template windows")

                              Comment

                              • eger
                                Member
                                • Nov 2006
                                • 95

                                #30
                                zabbix_sender.exe -V will tell the version.

                                I just tested on my installed and it works fine with 1.8.3 agent and 1.8.4 server.

                                In your item I noticed you filled out the units field. Is this an actual name or a special field for converting the value to a specified unit? I think this might be used to do unit conversion. Try blanking out this field and trying again.

                                Comment

                                Working...