Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Custom service monitors with retained data tracking expand on the basic Custom service monitor by allowing you to retain and graph historical trending information returned from your custom script. This enables you to store up to 10 custom application or business metrics per monitor within up.time just like system performance metrics returned by the up.time agent. This article builds on the scripts and knowledge that were developed in a previous article. Take some time to review the previous article before continuing.


Code Block
`echo -n /opt/uptime-agent/my-scripts/ my-arguments | /usr/local/uptime/scripts/agentcmd -p $PORT $AGENT rexec secretpassword > $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
if [ $? -eq 0 ]
echo "Could not execute agent side script!" 
# by exiting with a 2 we are forcing a CRIT service outage
exit 2

# in this script we don't need to check thresholds or determine which information to check
# we just need to reformat the agent side script output slightly so that only numerical info is displayed
# we do this by trimming off the first word returned on each line from the agent, leaving just the numbers
# and printing that to screen, up.time will handle the rest

awk '{print $2}' $TMPFILE

exit 0