Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Error #1

Open
Vilksalsa opened this issue Jan 10, 2022 · 4 comments
Open

JSON Error #1

Vilksalsa opened this issue Jan 10, 2022 · 4 comments

Comments

@Vilksalsa
Copy link

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
Copy link
Owner

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
Copy link
Author

Vilksalsa commented Jan 11, 2022

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
Copy link
Owner

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

@Vilksalsa
Copy link
Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants