Andy Gaskell (Customer) asked a question.

Active Monitor for Disk Threshold using VBScript connecting to WUGDB

Hi all, we're trying to move from V16 to 2023, we've had an active monitor in place for years, configured as a vbscript connecting to the WUG database. Added it to 2023 and the monitor just shows "UP" no matter what the status of the device. We have disk threshold configured to 90% and have triggered this, but the Active Monitor remains UP. Notification profiles aren't hitting the spot. We use the Active monitor "DOWN" status to automatically trigger an email to our call logging system in a specific format stating the "disk" monitor is down. Wondering if anyone can help? Attached is the current Script. Thanks in advance.


  • Mike Rockwell (Progress Software)

    I cleaned up the SQL query a bit, try this one.

    1. Option Explicit
    2. 'Create WhatsUp DB connection object
    3. Dim oDB : Set oDB = Context.GetDB
    4. 'Get the deviceID
    5. Dim nDeviceID : nDeviceID = Context.GetProperty("DeviceID")
    6. 'SQL Query
    7. Dim sSql : sSql = "select ACI.sDisplayName, ACI.sAspectValue, PAA.sAlertDescription, ACI.sAspectName, PAA.sAlertName, ACI.dAlertTime, ACI.nAlertCenterItemsID from AlertCenterItems ACI " &_
    8. "INNER Join ProActiveAlert PAA on PAA.nProActiveAlertID = ACI.nProActiveAlertID " &_
    9. "where (ACI.bActive = 1 and ACI.nDeviceID = " &nDeviceID & " and ACI.nProActiveAlertID = 44)"
    10. Dim sAspectValue, sAlertDescription, sAlertName, dAlertTime, sAspectName, sDisplayName, nAlertCenterItemsID, nPreviousAlertItems, nCurrentAlertCenterItemId
    11. Dim sMsg : sMsg = ""
    12. Dim bStatus : bStatus = 0
    13. 'Execute sql query
    14. Dim oRS: Set oRS = oDB.Execute(sSql)
    15. If Not oRS.EOF Then
    16. oRS.MoveFirst
    17. If Not oRS.EOF Then
    18. bStatus = 1 'Set status down if records are returned
    19. Do While Not oRS.EOF
    20. sDisplayName = oRS("sDisplayName")
    21. sAspectValue = oRS("sAspectValue")
    22. sAspectName = oRS("sAspectName")
    23. sAlertDescription = oRS("sAlertDescription")
    24. sAlertName = oRS("sAlertName")
    25. dAlertTime = oRS("dAlertTime")
    26. nCurrentAlertCenterItemId = oRS("nAlertCenterItemsID")
    27. nAlertCenterItemsID = nAlertCenterItemsID & "," & oRS("nAlertCenterItemsID")
    28. sMsg = sMsg & sAlertName & " " & sAspectName & " " & sAspectValue & vbCrLf
    29. oRS.MoveNext
    30. Loop
    31. End If
    32. End If
    33. 'Set the status
    34. If bStatus = 0 Then
    35. sMsg = "No alert center thresholds are tripped"
    36. Context.SetResult bStatus, sMsg
    37. Else
    38. Context.SetResult bStatus, sMsg
    39. End If

    Are you just wanting a monitor for disk utilization > 90%? You may want to look at using the API.

  • Andy Gaskell (Customer)

    Hi Mark, thank you so much for taking the time to clean up the SQL code, I've added it in and we're doing some testing now. It literally is just the disk active monitor for over 90% we need. It's saved us many times over the years we've had it. We haven't actually used the API up to now. Our call logging software is automatically logging a call from a specific email format when the device status has the active monitor "down" and it lists the Disk active monitor in the call contents. Will update after we've tested the new script! Thanks again!