vMarkusK / Advanced-PRTG-Sensors

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

Sensor output incomplete #31

Closed eren-kemer closed 6 years ago

eren-kemer commented 6 years ago

Sensor failing. Issue is that the sensor output is incomplete when run with PSx64.exe.

Running Psx64 with the powershell script returns only almost the end of the output:

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>PSx64.exe -f="
PRTG-VeeamBRStats.ps1"
0:\VeeamBackup</channel>
  <value>86</value>
  <unit>Percent</unit>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMinWarning>20</LimitMinWarning>
  <LimitMinError>10</LimitMinError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>REPO - VMware VM Backup Repository</channel>
  <value>64</value>
  <unit>Percent</unit>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMinWarning>20</LimitMinWarning>
  <LimitMinError>10</LimitMinError>
  <LimitMode>1</LimitMode>
</result>
</prtg>

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>

whereas running the script without PSx64.exe, the script returns everything in the output.

PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\PRTG-Vee
amBRStats.ps1
<prtg>
<result>
  <channel>Successful-Backups</channel>
  <value>1</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Warning-Backups</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxWarning>0</LimitMaxWarning>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failes-Backups</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failed-Backups</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Running-Backups</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>TotalBackupRead</channel>
  <value>47</value>
  <unit>Custom</unit>
  <customUnit>GB</customUnit>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>TotalBackupTransfer</channel>
  <value>17</value>
  <unit>Custom</unit>
  <customUnit>GB</customUnit>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Successful-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Warning-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxWarning>0</LimitMaxWarning>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failes-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failed-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Running-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Idle-BackupCopys</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Successful-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Warning-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxWarning>0</LimitMaxWarning>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failes-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failed-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Running-Replications</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Successful-Endpoints</channel>
  <value>2</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>Warning-Endpoints</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxWarning>0</LimitMaxWarning>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Failes-Endpoints</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMaxError>0</LimitMaxError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>Running-Endpoints</channel>
  <value>0</value>
  <showChart>1</showChart>
  <showTable>1</showTable>
</result>
<result>
  <channel>REPO - Endpoint Backup Repository</channel>
  <value>64</value>
  <unit>Percent</unit>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMinWarning>20</LimitMinWarning>
  <LimitMinError>10</LimitMinError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>REPO - Laufwerk D:\VeeamBackup</channel>
  <value>86</value>
  <unit>Percent</unit>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMinWarning>20</LimitMinWarning>
  <LimitMinError>10</LimitMinError>
  <LimitMode>1</LimitMode>
</result>
<result>
  <channel>REPO - VMware VM Backup Repository</channel>
  <value>64</value>
  <unit>Percent</unit>
  <showChart>1</showChart>
  <showTable>1</showTable>
  <LimitMinWarning>20</LimitMinWarning>
  <LimitMinError>10</LimitMinError>
  <LimitMode>1</LimitMode>
</result>
</prtg>
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>

I believe the issue might be because of "Laufwerk D:\" in the channel name.

vMarkusK commented 6 years ago

You are right, the syntax

D:\

is causing an issue with PSx64.exe. You can use the -raw switch as workaround.

eren-kemer commented 6 years ago
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>PSx64.exe -f="
PRTG-VeeamBRStats.ps1" -raw
0

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>

Didn't work as expected. Am i doing it wrong?

vMarkusK commented 6 years ago

No, it seems to be a problem with PSx64.exe in general. I created a simple testcase with only one output line in a PowerShell Script and ran into the same problem.

Might you please verify that:

C:\tools>PSx64.exe -f="test.ps1"
0:Write Host
Write Output

C:\tools>PSx64.exe -f="test.ps1" -raw
0

Test Code: test.zip

`

eren-kemer commented 6 years ago

Same Behaviour.

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>PSx64.exe -f="
test.ps1"
0:Write Host
Write Output

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>PSx64.exe -f="
test.ps1" -raw
0

C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML>
vMarkusK commented 6 years ago

Ok, a Support Case should be opened...

eren-kemer commented 6 years ago

Will you, or should I open a support case?

vMarkusK commented 6 years ago

Might you take care of that?

eren-kemer commented 6 years ago

Sent a mail to prtgtoolsfamily. Will keep you updated!

eren-kemer commented 6 years ago

I have received a modified Psx64.exe . That has worked and is going to be published on the website soon.

vMarkusK commented 6 years ago

Thanks for your feedback!