How to uninstall the UptimeToolbox Linux Agent

The one-liner

So you just want the linux agent removed from your servers as quickly as possible. We’ve created an uninstall script just for that purpose. To use it, from your terminal you can run

sudo curl -s https://raw.githubusercontent.com/uptimetoolbox/uptimetoolbox-agent/master/uninstall.sh | sudo bash

The manual way

If you however want to know everything that happens on your server you can login as a superuser and use the manual approach below

# If this system uses systemd then disable the service
if [ -x "$(command -v systemctl)" ] && [ -e '/etc/systemd/system/uptimetoolbox.timer' ]; then
  systemctl -q disable uptimetoolbox.timer
fi

# If this system uses init.d then remove from crontab
if [ -x "$(command -v crontab)" ]; then
  crontab -l | grep -v '/uptimetoolbox/agent.sh' | crontab -
fi

# Remove temp files & agent
rm /tmp/ut_data.stat
rm -rf /opt/uptimetoolbox
rm -rf /etc/systemd/system/uptimetoolbox.*