We are trying to get an EXE/Script Advanced Sensor to work without success.
It is basically a powershell script which returns a JSON as result.
The result of sensor in the log file looks like this:
{ "prtg": { "result": [ { "channel": "TestIdentifier", "value": "Main" }, { "channel": "TotalDuration", "value": "159.6382298" }, { "channel": "FirstProcessingTime", "value": "150.5721438" }, { "channel": "ApplicatonExecution", "value": 915 }, { "channel": "TotalExecution", "value": 3945 }, { "channel": "CacheHitRation", "value": 0.76806083650190116 }, { "channel": "TotalExecutionTime", "value": "9.066086" }, { "channel": "TotalExecutionApplicatonTime", "value": "6.2064968" }, { "channel": "TotalExecutionDbTime", "value": "0.9997484" }, { "channel": "CommunicationTime", "value": "2.8595892" }, { "channel": "ApplicatonProcessingTime", "value": "5.2067483999999995" }, { "channel": "Errormessage", "value": "" } ] } }
And in the "data" log file it states:
Data['lastmsg'].asString := '#Y2 @#O233 @#O231['Main' is not a valid integer value]';
And in the Web GUI it shows the following error:
XML: Structural error in xml file, 1 open items. -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)
Can anyone please give an advice on how to solve this?
- Is the structure of the JSON correct?
- Are the channels automatically created on first result or do we need to create them manually in the Web GUI?
- Do we need to specify the type of value in the JSON?
Add comment