...
Code Block | ||
---|---|---|
| ||
`/usr/local/uptime/scripts/agentcmd -p $PORT $AGENT rexec secretpassword /opt/uptime-agent/my-scripts/show_temp.sh my-arguments > $TMPFILE` |
For more information on see Using the syntax used with agentcmd, see this Knowledge Base articleagentcmd utility.
Code Block | ||
---|---|---|
| ||
# we have the output from the agent. If it is ERR that means there was a problem running the script on the agent `grep ERR $TMPFILE` if [ $? -eq 0 ] then echo "Could not execute agent side script!" # by exiting with a 2 we are forcing a CRIT service outage exit 2 fi # because our agent side script produces output that fits into the plug-in monitor format # we don't have to format our output at all, simply print it to the screen and we are finished. cat $TMPFILE exit 0 |
...