none
Created VBS Script Monitor, Not executing on schedule RRS feed

  • Question

  • I've created a filesize vbs monitor.  I've associated it with a group of servers.  I see the MP distribute to those servers.  Yet my script does not execute every 30 minutes as configured.  I've added a oAPI.LogScriptEvent to the script that is not writing to the event log.  If I run the VBS on the server, it runs fine and returns the oBag with anticipated results.  No errors in the event log either.

    Please advise...

    Option Explicit
    Dim oAPI, oBag, objFSO, objFile, varSize, oArgs, filepath, threshold
    Set oArgs = Wscript.Arguments
    
    filepath = oArgs(0)
    threshold = int(oArgs(1))  'Should be 0
    
    Set oAPI = CreateObject("MOM.ScriptAPI")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.GetFile(filepath)
    
    varSize = objFile.Size
    
    If varSize <= threshold Then
     Set oBag = oAPI.CreatePropertyBag()
     Call oBag.AddValue("Status","Bad")
     Call oBag.AddValue("Size", varSize)
     Call oBag.AddValue("Threshold", threshold)
     Call oAPI.LogScriptEvent("wmsfilesize.vbs", 825, 1, "There have been NO DNLD records loaded into the om_f table within the last hour.  The current size is: " & varSize & " bytes")
     Call oAPI.Return(oBag)
    Else
     Set oBag = oAPI.CreatePropertyBag()
     Call oBag.AddValue("Status","Ok")
     Call oBag.AddValue("Size", varSize)
     Call oBag.AddValue("Threshold", threshold)
     Call oAPI.LogScriptEvent("wmsfilesize.vbs", 825, 0, "DNLD records have been loaded into the om_f table within the last hour.  The current size is: " & varSize & " bytes")
     Call oAPI.Return(oBag)
    End If


    Tuesday, June 27, 2017 5:00 PM

Answers

  • Hi Sir,

    Sorry for the delay .

    First , I'd suggest you search if that script is applied to that server and exists in "temporary files" :

     

    I'v also tested it in my lab ,it works fine .

    The steps I followed :

    1. create a monitor , target to windows server (not enabled )

    2. copy that script into the wizard and manually change the "constants"

    filepath = "c:\xxx\xxx.xxx"
    threshold = 0  

    3. configure "healthy" and "unhealthy" .

    4. override it to a specific server with option "specific object of the selected class" 

    check the event log when I create a file match that path with 0 kb .

    Then I got the eventlog :

    Hope it is helpful to you .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Mark DeLo Monday, July 10, 2017 12:43 PM
    Monday, July 10, 2017 2:55 AM
    Moderator

All replies

  • Hi Sir,

    Sorry for the delay .

    First , I'd suggest you search if that script is applied to that server and exists in "temporary files" :

     

    I'v also tested it in my lab ,it works fine .

    The steps I followed :

    1. create a monitor , target to windows server (not enabled )

    2. copy that script into the wizard and manually change the "constants"

    filepath = "c:\xxx\xxx.xxx"
    threshold = 0  

    3. configure "healthy" and "unhealthy" .

    4. override it to a specific server with option "specific object of the selected class" 

    check the event log when I create a file match that path with 0 kb .

    Then I got the eventlog :

    Hope it is helpful to you .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Mark DeLo Monday, July 10, 2017 12:43 PM
    Monday, July 10, 2017 2:55 AM
    Moderator
  • Can you show us the screen captures of the configuration of the monitor? (not the XML, I'm too lazy to wade through it :)

    &quot;Fear disturbs your concentration&quot;

    Monday, July 10, 2017 3:46 PM