Jannos-443 / PRTG-DataCore

PRTG DataCore Sensor
MIT License
1 stars 0 forks source link

"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)" #1

Closed tsc-ham closed 2 years ago

tsc-ham commented 2 years ago

Hello Jannos, we came across your scripts while looking for a DataCore / PRTG integration and would love to use them. Unfortunately, we get the following error message back when we include this in PRTG as a sensor:

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

Do you have any idea what could be wrong here?

Jannos-443 commented 2 years ago

Hey, could you send me the sensor log (full text file would be the best) from prtg and the powershell output if you run it directly in powershell?

tsc-ham commented 2 years ago

Hi, here the PowerShell output from PRTG-DataCore.ps1:

<prtg><result>
        <channel>Error Count</channel>
        <value>0</value>
        <unit>Count</unit>
        <limitmode>1</limitmode>
        <LimitMaxError>0</LimitMaxError>
        </result>
        <result>
        <channel>Warning Count</channel>
        <value>0</value>
        <unit>Count</unit>
        <limitmode>1</limitmode>
        <LimitMaxWarning>0</LimitMaxWarning>
        </result><text>No Alerts found</text></prtg>

PRTG output is attached

Result of Sensor 12138.Data.txt

Jannos-443 commented 2 years ago

Powershell output looks good, could you also upload the "Result of Sensor xxxxx.txt" from the sensor

tsc-ham commented 2 years ago

the sensor result is attached to the same comment above

Jannos-443 commented 2 years ago

I can only see the result data file, there should also be one file with just result in the name.

tsc-ham commented 2 years ago

There was a file created with the name "Result of Sensor 12138.txt" without any content

Jannos-443 commented 2 years ago

Could you please download the latest Version and check again? The should be output in the "Result of Sensor xxx.txt"

tsc-ham commented 2 years ago

We have tested the new script. When executed manually via PowerShell, it works. When running it via PRTG we get an error message regarding the signature of the script.

I attach the results as a text file.

Result of Sensor 12160.txt Result of Sensor 12160.Data.txt manualusage.txt

tsc-ham commented 2 years ago

We were able to solve the problem with script signing.There are different settings for script execution for 32bit and 64bit Powershell.

tsc-ham commented 2 years ago

Unfortunately, it doesn't quite work with the query yet. We have created a new sensor and included the script.

With the parameter "DcsStatus" four channels are filled with data. The rest remain empty.

The empty channels show the following error message: "At least one channel uses a lookup that is not available or could not be loaded."

If you want to take another look, here are the logs:

PRTG-four-sensors-filled ps_log.txt Result of Sensor 12567.Data.txt Result of Sensor 12567.txt

Jannos-443 commented 2 years ago

oh that is my bad, I forgot to add the lookup files to Github. Please look in the readme again, I added step 6/7 "lookup Files"

tsc-ham commented 2 years ago

The DataCore connection now works properly. Thanks for the support with the integration of your scripts and in general for the great work you provide for free.

Jannos-443 commented 2 years ago

thanks for the great feedback :) Any suggestions to improve the sensor are welcome. (or for new Sensors)