Pandora FMS Community

windows update VBScript intervals not working

bloopie1 · 13 abr 2015, 15:16 · 4 mensajes · 64 visitas

  1. Inicio del debate

    Hey everyone, So i recently started working for a new company, they are using Pandora FMS to monitor their servers and i am tasked with updating the entire system. Right now i have a full configuration ready for pandora except for this one tiny thing, the windows update script that i took from the pandora site is not doing the interval that it's supposed to. I set the interval to 144x (300 seconds standard) so that adds up to 12 hours. In Pandora the system shows that the interval is supposed to be 12 hours as well, but when i look at the servers running in our environment this doesn't seem to be the case, instead of the 12 hours the vbscript will refresh all together with the pandora config every 5 minutes. Now i tried adding it in multiple ways, let me show you: In the pandora config this is the line to look up and start the VBscript: # Windows Update status module_plugin cscript.exe //B "C:Program Files (x86)Pandora_Agentutilwindows_update.vbs" When downloading this VBscript (which does return the right values btw) , the author added that this was the way to call the script and let it run. When i run the script from either CMD or powershell i get the right information as well. I also tried adding this line under that config line: module_interval 144 Which is not doing anything. The script looks like this: Set updateSession = CreateObject("Microsoft.Update.Session") Set updateSearcher = updateSession.CreateupdateSearcher() Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'") Set colUpdates = searchResult.Updates updatesOptional = 0 updatesHigh = 0 For i = 0 to colUpdates.Count - 1 if (colUpdates.Item(i).IsInstalled = False AND colUpdates.Item(i).AutoSelectOnWebSites = True) Then updatesHigh = updatesHigh + 1 else updatesOptional = updatesOptional + 1 End IF    Next intData = 0 if (searchResult.Updates.Count > 0) then intData = 1 end if Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "Windows Update" Wscript.StdOut.WriteLine "0 if no update available, 1 if updates (priority or optional) are available" Wscript.StdOut.WriteLine "generic_data" Wscript.StdOut.WriteLine "" & intData & "" Wscript.StdOut.WriteLine "144" Wscript.StdOut.WriteLine "Updates" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "Priority Updates Pending" Wscript.StdOut.WriteLine "Pending updates (high priority)" Wscript.StdOut.WriteLine "generic_data" Wscript.StdOut.WriteLine "" & updatesHigh & "" Wscript.StdOut.WriteLine "15" Wscript.StdOut.WriteLine "0" Wscript.StdOut.WriteLine "144" Wscript.StdOut.WriteLine "Updates" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "" Wscript.StdOut.WriteLine "Optional Updates Pending" Wscript.StdOut.WriteLine "Pending updates (Optional)" Wscript.StdOut.WriteLine "generic_data" Wscript.StdOut.WriteLine "" & updatesOptional & "" Wscript.StdOut.WriteLine "15" Wscript.StdOut.WriteLine "0" Wscript.StdOut.WriteLine "144" Wscript.StdOut.WriteLine "Updates" Wscript.StdOut.WriteLine "" as you can see the module_interval has been added, i also tried using just 144 but this reports back in pandora as a nothing, it shows as a sidenote next to the module as 144 and doesn't update the interval time in pandora either. When i used 144 it will show up as 12 hours in pandora but still refresh it every 5 minutes. I think i know what's going wrong but can't seem to solve it either, it looks like the script runs before it can tell itself that the interval is supposed to be 12 hours, how can i fix this? Since i can't let the module_plugin part work with intervals so far and i am unable to find more information about it, that's why i'm turning to these forums to see if someone out there can help me with this. I know i will be needing the intervals on VBscripts more often in the near future so any other workaround (like converting the script to powershell, which i know works with intervals) is not something i'm too happy about since that would take me more time to convert scripts to powershell. If anyone can help you would make me really happy :) Thanks in advance.

  2. Hi bloopie1, When you launch a plugin execution, you must to indicate the execution interval twice: One in the XML response as VALUE And, in the call to the module_plugin, in the pandora_agentpandora_agent.conf as module_begin module_interval 144 module_plugin cscript.exe //B "%PROGRAMFILES%Pandora_Agentcollectionstestwupdate.vbs" module_end Guess it works for you, Best regards

  3. hey fborja, thanks for your response! It's a solution i haven't tried yet, but i also fixed my issue. Right now i am using a powershell script to run something similar to get my Windows Update information, it's kind of slow so that is a big downside. I will certainly try your solution today in our environment, crossing my fingers that it works since this vbscript is alot faster in getting the required information! Thanks a bunch in advance. I'll report back if it worked or not!

  4. yeah! thank you for the feedback :D

Entra en tu cuenta para publicar.