I have established an advanced SSH sensor to SSH into a Raspberry Pi and execute a script, speedTesh.sh I can execute this script without issue and get my desired output. When running the script through PRTG's sensor, I have a common failure of 'No valid result from SSH Shell' for about 65% of the polls, and the rest of the time I get a proper response of data.
This is the log for a normal output:
linux Last login: Tue May 28 15:24:11 2013 from 184.173.111.37-static.reverse.softlayer.com root@raspberrypi:~# echo PAESSHSTART;/var/prtg/scriptsxml/speedTest.sh ;printf " \n";echo PAESSHEND PAESSHSTART <prtg> <result> <channel>Download Speed</channel> <value>34672</value> <unit>custom</unit> <customunit>kbit/s</customunit> </result> <result> <channel>Upload Speed</channel> <value>67868</value> <unit>custom</unit> <customunit>kbit/s</customunit> </result> </prtg> PAESSHEND root@raspberrypi:~# --------------------------------------------------------------
This is the log for the output when I get a no valid result error:
linux Last login: Tue May 28 15:34:11 2013 from 184.173.111.37-static.reverse.softlayer.com echo PAESSHSTART;/var/prtg/scriptsxml/speedTest.sh ;printf "\n";echo PAESSHEND root@raspberrypi:~# echo PAESSHSTART;/var/prtg/scriptsxml/speedTest.sh ;printf " \n";echo PAESSHEND PAESSHSTART <prtg> ----------------------------------------------------
This script will display the <prtg> tag right away and then will have an extended pause for 15 seconds while waiting for background data to be generated. Once the 15 seconds have finished the rest of the output follows. I have increased the sensor's connection timeout to 2 minutes and the shell timeout to 1 minute to no avail. I have tested an SSH connection from the PRTG probe itself to the target device and had no issues executing the script via PuTTy. I have also added a counter to my script to try and determine if the sensor fails due to a timeout, and this is the result every time it fails. Every number is 1 second passed while the script is executing:
linux Last login: Tue May 28 16:49:13 2013 from 184.173.111.37-static.reverse.softlayer.com echo PAESSHSTART;/var/prtg/scriptsxml/speedTest.sh ;printf "\n";echo PAESSHEND root@raspberrypi:~# echo PAESSHSTART;/var/prtg/scriptsxml/speedTest.sh ;printf " \n";echo PAESSHEND PAESSHSTART <prtg> 1
Is there some rare quirk with the probe's SSH system that I am unaware of? It all seems to come back to an instability in the probe itself rather than my script, but I cannot tell for certain.
PRTG version 13.1.3.1643
Add comment