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 GetNetworkData | |
'Clear total counters | |
TotalBytesReceivedPerSec = 0 | |
TotalBytesSentPerSec = 0 | |
TotalBytesTotalPerSec = 0 | |
TotalPacketsReceivedPerSec = 0 | |
TotalPacketsSentPerSec = 0 | |
TotalPacketsReceivedDiscarded = 0 | |
TotalPacketsReceivedError = 0 | |
TotalPacketsSentDiscarded = 0 |
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
Set colConfs = objWMI.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True") | |
For Each objConf in colConfs | |
strAdapterName = GetAdapterName(objConf.Caption) | |
strIPAddress = GetMultiString_FromArray(objConf.IPAddress, ", ") | |
Set colNetAdapters = objWMI.ExecQuery("Select * From Win32_NetworkAdapter WHERE Caption = '" & objConf.Caption & "'") | |
For Each objAdapter In colNetAdapters | |
WScript.Echo "Adding monitor for network connection: " & objAdapter.NetConnectionID |
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
'Total Bytes Troughput | |
Row = 1 : Column = 1 | |
MonitorName = "Total+Bytes+Throughput" | |
monitorParams = "Total+Bytes+Throughput:Bandwidth:Bandwidth:3:false;" | |
resultParams = "TotalBytesReceivedPerSec:Received/Sec:N%2FA:2;TotalBytesSentPerSec:Sent/Sec:N%2FA:2;TotalBytesTotalPerSec:Total/Sec:N%2FA:2;" | |
AddCustMon | |
'Total Packets/Sec | |
Row = 1 : Column = 2 | |
MonitorName = "Total+Packets" |
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
namespace MonitisTop | |
{ | |
public class MonitorDefinition | |
{ | |
private string metric; | |
private List<string> names; | |
private List<string> suffixes; | |
public string Metric { get { return metric; } set { metric = value; } } | |
public List<string> Names { get { return names; } set { names = value; } } |
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
namespace MonitisTop | |
{ | |
public class Metric | |
{ | |
protected Monitor monitor; | |
private string name; | |
private string result; | |
private string suffix; | |
private int width; |
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
namespace MonitisTop | |
{ | |
/// <summary> | |
/// Global monitor class | |
/// </summary> | |
public class GlobalMonitor : Monitor | |
{ | |
public GlobalMonitor(Agent _agent) | |
: base(_agent) | |
{ |
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
namespace MonitisTop | |
{ | |
/// <summary> | |
/// Base monitor class | |
/// </summary> | |
public class Monitor | |
{ | |
protected Agent agent; | |
protected string id; |
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
namespace MonitisTop | |
{ | |
public class Agent | |
{ | |
private string id; | |
private string name; | |
private int maxMonitorWidth; | |
private List<Monitor> monitors; | |
public string Id { get { return id; } set { id = value;} } |
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 GetFullpageMonitors(aObjHttp, aObjAgent, aShowMonitors) | |
Dim objAgents, xmlAgents | |
Set objAgents = CreateObject("Scripting.Dictionary") | |
'Create the dummy Agent object | |
Set Agent = New class_InternalAgent | |
Agent.Id = "" | |
Agent.Name = "FULLPAGE" | |
url = "http://www.monitis.com/api?version=2&apikey=" & apikey & "&output=xml&action=topFullpage&limit=50&detailedResults=true" |
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 GetExternalMonitors(aObjHttp, aObjAgents, aShowMonitors) | |
Dim objAgents, xmlAgents | |
Set objAgents = CreateObject("Scripting.Dictionary") | |
'Create the dummy Agent object | |
Set Agent = New class_InternalAgent | |
Agent.Id = "" | |
Agent.Name = "EXTERNAL" | |
WScript.Echo "Acquiring external monitors..." |
NewerOlder