Jannos-443 / PRTG-WinEvent

Monitors Windows Eventlog with the ability to exclude and include.
MIT License
5 stars 0 forks source link

JSON Error #1

Open Vilksalsa opened 2 years ago

Vilksalsa commented 2 years ago

Hi so i am trying to run your script but it is throwing the following error:

XML: Junk after document element -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)

Not sure what it's complaining about. The script works fine from the server it self but it seems prtg isn't to happy about how it's getting the output back.

Jannos-443 commented 2 years ago

Hello, please make sure you set the x86 Powershell execution Policy. Could you please append the Sensor Output Log: "Result of Sensor XXX.log" and "Result of Sensor XXX.Data.txt"

Vilksalsa commented 2 years ago

Hi Jannos yea i have set all of that correctly and i see there is some text that comes back in the results that is outside of the closing prtg tags i believe it may be what is causing the problem.

This shows in the Result of sensor text after the closing prtg tags: System.Diagnostics.Eventing.Reader.EventLogConfiguration System.Diagnostics.Eventing.Reader.ProviderMetadata Result of Sensor 6831.txt Result of Sensor 6831.log Result of Sensor 6831.Data.txt *

Jannos-443 commented 2 years ago

I just updated the Script, could you please try it again and provide logs again if it doesn´t :)

Vilksalsa commented 2 years ago

Hey thanks for the quick fix. It works great now! :D Thanks a bunch and i hope more people use this script. PRTG's own script doesn't work either :)