Skip to content

Instantly share code, notes, and snippets.

@abarnas
Created October 12, 2011 21:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abarnas/1282582 to your computer and use it in GitHub Desktop.
Save abarnas/1282582 to your computer and use it in GitHub Desktop.
Monitis Top Get Global Monitors
Function GetGlobalMonitors(aObjHttp, oNames, aObjAgent, aShowMonitors)
Dim oName
For Each oName in oNames
If oName.NodeName <> "#text" And oName.NodeName <> "process" And _
SupportedMonitors.Exists(LCase(oName.NodeName)) And _
aShowMonitors.Exists(LCase(oName.NodeName)) Then
' Create new monitor object
Set Monitor = New class_Monitor
Monitor.Name = GetMonitorName(oName.selectSingleNode("name").text)
strMonitorName = LCase(GetMonitorBaseName(Monitor.Name))
Monitor.Id = UCase(oName.selectSingleNode("id").text)
Monitor.DisplayName = UCase(Monitor.Name)
url = "http://www.monitis.com/api?version=2&apikey=" & apikey & "&output=xml&action=top" & strMonitorName & "&limit=50&detailedResults=true"
aObjHttp.open "GET", url, False
aObjHttp.send
Set oRes = CreateObject("Microsoft.XMLDOM")
oRes.async = False
oRes.LoadXML(aObjHttp.responseText)
Set oNode = oRes.selectSingleNode("data/tests")
If Not oNode Is Nothing Then
For Each oCell In oNode.childnodes
GetResult oCell, Monitor, SupportedMonitors(strMonitorName)
Next
aObjAgent.MonitorList.Add Monitor.Name, Monitor
End If
End If
Next
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment