Created
October 12, 2011 21:10
-
-
Save abarnas/1282582 to your computer and use it in GitHub Desktop.
Monitis Top Get Global Monitors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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