I have been setting up Custom SSH Script/Sensors for our Linux boxes. The documentation and example are great, most scripts are running perfectly. I have run into an issue when trying to set the return value using a variable, for example:
This works fine from a script:
echo "0:50:Ok"
This always causes the value in the PRTG sensor to be 0 (like its a string):
COUNT=`expr 25 + 25`
echo "0:${COUNT}:Ok"
The output on the screen when manually running these is the same:
0:50:Ok
0:50:Ok
I've tried typeset -i, declare -i on the COUNT variable to be sure its an integer. I've tried changing around how the output is wrapped, and regardless of whether the script outputs 0:50:Ok, if the 50 came from a variable the sensor does not like it.
I'd love to be able to track the actual 'value' without building a crazy CASE statement to handle every possibility.
I've also tried setting the returncode as an variable, that seems to work just fine:
RETCODE="1"
echo "${RETCODE}:50:Warning"
Thanks for any direction on this.
Add comment