I use a vbscript custom sensor and set use Windows credentials of parent device but will return "Access denied. Please check your Windows credentials. (code: PE095)".

But other sensor use WMI not return any error


Article Comments

Hello,

Could you please post the script that you are trying to run in this sensor?

If possible, please also upload some screenshots of the sensor.


Jul, 2016 - Permalink

Hello, This is my code

strComputer = ""

strUser = ""
strPassword = ""

strNamespace = "root/cimv2"

Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer(strComputer,strNamespace,strUser,strPassword)
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process WHERE name ='svchost.exe'")


if colItems.Count < 3 then
  wscript.echo colItems.Count&":Ok"
  wscript.quit("0")
Else
  wscript.echo colItems.Count&":Too many processes"
  
  REM This sets the sensor into "Warning" State
  wscript.quit("1")
End if

is there need enter any parameter at parameters field


Jul, 2016 - Permalink

Can you try to enter the computer, user and password in the script and check if it works out?


Jul, 2016 - Permalink

yes, it can work.


Jul, 2016 - Permalink

Hello, if I enter the computer, user and password in the script it returns this error "XML: The returned xml does not match the expected schema. (code: PE233) -- JSON: The returned json does not match the expected structure (Invalid JSON.). (code: PE231)", but if I use this code at localhost it no error, I don't know what wrong with it, can you help me?


Jul, 2016 - Permalink

What sensor type are you using? EXE/XML or EXE/XML (advanced)?


Jul, 2016 - Permalink

I use EXE/XML sensor.


Jul, 2016 - Permalink

Now, it have another error is "Response not wellformed: "(C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\Demo VBScript - Returns warning depending on number of svchost processes.vbs(9, 1) SWbemLocator: Access is denied. )" (code: PE132)" please help me


Jul, 2016 - Permalink

I think the script is a rather lost cause - from what I can tell, you try to monitor the amount of svchost.exe instances. Couldn't you use the Windows process sensor for that? Is has a channel with the instance amount; simply apply limites to it and you can trigger notifications for that.


Jul, 2016 - Permalink