I have used a vbs script I found in the Paessler KB which uses static entries in the script for a website and a return status code. The sensor works great like this. After I've altered the script to accept parameters the script still works and returns the same status when run on the server but the sensor errors out with "System Error: OK (Code: PEO22)"
sUrl = Wscript.Arguments(0) sStatusToCheck = Wscript.Arguments(1) If Wscript.Arguments.Count = 1 then sUrl = Wscript.Arguments(0) End If If Wscript.Arguments.Count = 2 then sUrl = Wscript.Arguments(0) sStatusToCheck = Wscript.Arguments(1) End If Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0") oXMLHTTP.Open "GET", sUrl, False, " "," " oXMLHTTP.Send WScript.Echo oXMLHTTP.Status & ":" & oXMLHTTP.StatusText If oXMLHTTP.Status = sStatusToCheck then WScript.Quit("0") Else WScript.Quit("2") End If
Add comment