vMarkusK / Advanced-PRTG-Sensors

Collection of my Advanced PRTG Sensors
https://mycloudrevolution.com/
Apache License 2.0
67 stars 29 forks source link

Issue on PRTG with Custom Sensor #7

Closed jonnyj192 closed 7 years ago

jonnyj192 commented 7 years ago

When trying to use this for PRTG reporting i get the following issue? could you help me please:

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)

vMarkusK commented 7 years ago

Sure, Might you please execute the Script in cmd shell and share the result? Sensor log will also be awsome.

jonnyj192 commented 7 years ago

Report of Sensor: File "C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG.ps1" not found.

Report of Sensor.Data: Data['blockedsens'].asString := ''; Data['canlinux'].asString := '0'; Data['channelinfos'].asString := '{}'; Data['channelnames'].asString := ''; Data['exefile'].asString := 'PSx64.exe'; Data['exeparams'].asString := '-f=PRTG.ps1 -raw'; Data['fastcount'].asString := '0'; Data['host'].asString := '172.16.3.2'; Data['hostv6'].asString := ''; Data['inerror'].asString := '1'; Data['interfacenumber'].asString := ''; Data['inum'].asString := ''; Data['ipversion'].asString := '0'; Data['isexesensor'].asString := '1'; Data['lastmsg'].asString := '#Y2 @#O233 @#O231[Invalid JSON.]'; Data['lastuptime'].asString := '0'; Data['linuxlogindomain'].asString := ''; Data['linuxloginpassword'].asString := '***'; Data['monitorchange'].asString := ''; Data['mutexname'].asString := ''; Data['reboot'].asString := '42774.6879382407'; Data['reqmsginterval'].asString := '60'; Data['resultfile'].asString := 'Result of Sensor 4534.txt'; Data['sensorid'].asString := '4534'; Data['simulate'].asString := '0'; Data['timeout'].asString := '60'; Data['tlsexplicit_default'].asString := ''; Data['tlsexplicit_ftp'].asString := ''; Data['tlsexplicit_imap'].asString := ''; Data['tlsexplicit_pop3'].asString := ''; Data['tlsexplicit_port'].asString := ''; Data['tlsexplicit_smtp'].asString := ''; Data['uptimecount'].asString := '0'; Data['usednstime'].asString := '0'; Data['usewindowsauthentication'].asString := '1'; Data['windowslogindomain'].asString := ' Data['windowsloginpassword'].asString := ' Data['windowsloginusername'].asString := ' Data['writeresult'].asString := '1';

jonnyj192 commented 7 years ago

That is the powershell command ran through CMD, I have xxx out the point which are private.

Thanks for your help with this.

X:>powershell "& 'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EX EXML\PRTG.ps1'" Starting to Process Connection to XXXXXXXXXX Connecting BRHost...

Successful-Backups 1 1 1 Warning-Backups 0 1 1 0 1 Failes-Backups 0 1 1 0 1 Failed-Backups 0 1 1 0 1 Running-Backups 0 1 1 Successful-BackupCopys 0 1 1 Warning-BackupCopys 0 1 1 0 1 Failes-BackupCopys 0 1 1 0 1 Failed-BackupCopys 0 1 1 0 1 Running-BackupCopys 0 1 1 Idle-BackupCopys 0 1 1 Successful-Replications 0 1 1 Warning-Replications 0 1 1 0 1 Failes-Replications 0 1 1 0 1 Failed-Replications 0 1 1 0 1 Running-Replications 0 1 1 TotalBackupRead 299 Custom GB 1 1 TotalBackupTransfer 42 Custom GB 1 1 REPO - xxxxx 48 Percent 1 1 20 10 1 REPO – xxxxx2 17 Percent 1 1 20 10 1
vMarkusK commented 7 years ago

Hi, might you please verify that the PS1 Script is on all Probes and the Core available.

The PRTG Sensor Log reports that PSx64.exe can not find it:

Report of Sensor: File "C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\PRTG.ps1" not found.

jonnyj192 commented 7 years ago

HI,

When i change the name of the script and ran it again i got the below error. "The system cannot find the file specified" which is when it had a false name.

Just to confirm, the server which has the probe on is where i place the PSx64.exe and the PS1 script? all the data from the probe goes back to our central server offsite.

Thanks

vMarkusK commented 7 years ago

Hi,

The manual execution is not the Problem. I think the execution vie PRTG is the Problem. Is on all Probes where the PSx64.exe also the PS1 script located?

Yes, you are right the Probe for the Device where the Sensor is created executes the Script.

jonnyj192 commented 7 years ago

image

This is how its set up on PTRG, please could you advise on this situation?

Thanks

jonnyj192 commented 7 years ago

I have now resolved this issue thanks.

vMarkusK commented 7 years ago

Might you please share the Solution?

jonnyj192 commented 7 years ago

On this instance i recreated the PS1 file and edited DNS in the code to the IP address. This is now running however i'm still getting the Odd timeout which is frustrating...

Thanks