Use the package manger to properly uninstall the agent.
apt purge cagent on Debian and Ubuntu or
yum remove cagent on CentOS and RedHat.
After doing that clean up the old configuration and the logs by executing
rm -r /etc/cagent and
rm -r /var/log/cagent. You don't need them anymore.
Use the Windows Apps & Features management (also called Software Management on older systems). Just click on "uninstall" and you are done.
Clean up the settings and logs by deleting the entire folder
C:\Program Files\cagent You don't need it anymore.