Cloud identification
http_get.vbs script is used to a simple HTTP GET on the URL http://169.254.169.254/
to get metadata.
VBS functions
HTTP GET to retrieve instance metadata
set o = CreateObject("WinHttp.WinHttpRequest.5.1")
o.open "GET", "http://169.254.169.254/", false
Metrics collection
win_metrics_utility_1.X.vbs script collects the performance metrics on the server.
VBS functions
- Execute typeperf command to get performance perf metrics
CreateObject("WScript.Shell").exec(="cmd /c typeperf -si 5 " + counterList)
- Get time zone from the registry
CreateObject("WScript.Shell").RegRead("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias")
- Get Current language from the registry
GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer & "\root\default:StdRegProv").GetMultiStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\CurrentLanguage", "counter", arrValues
- An alternative way to get current language from the registry
GetObject("winmgmts:{impersonationLevel=impersonate}!\" & strComputer & "\root\default:StdRegProv").GetMultiStringValue HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009", "counter", arrValues
- Create info.log file containing the logs generated by the script
CreateObject("Scripting.FileSystemObject").OpenTextFile("info.log",2,true)
- HTTP Post to send the metrics to the local appliance
CreateObject("WinHttp.WinHttpRequest.5.1").open "POST", "http://192.168.3.8:8080",false
- Read metrics configuration file
set filesys = CreateObject("Scripting.FileSystemObject").OpenTextFile("metrics.conf", 1, false)