I'm having difficulty with output from a custom SSH script that I'm running on a Linux machine. The script outputs a time value - NTP offset in microseconds - as a number (1, 2, 15, 26, etc.). I'd like to capture that number and graph it. The script is written in perl, however I run it in bash for PRTG as:
#!/bin/bash
OFFSET="$(perl GetNTPoffset.pl)"
echo "0:${OFFSET}:OK"
I've also tried it without the quotes
#!/bin/bash
OFFSET="$(perl GetNTPoffset.pl)"
echo 0:${OFFSET}:OK
If I log into the Linux machine with the PRTG user account, navigate to the /var/prtg/scripts folder and run ./GetNRPoffset.sh
I get a return like 0:17:OK
. It's this '17' value that I'd like to graph.
This seems to fit within what PRTG is looking for returncode:value:message
, however in PRTG however, I get error P129: "Either the script was not runable, or the output could not be parsed (:OK)" It doesn't seem to matter what comes after the last colon (the 'message') - whatever it is generates an error.
Any suggestions?
Add comment