Removing the Server Scout agent from your Linux server is a straightforward process that can be accomplished either through the built-in uninstall command or manually. This guide covers both methods to ensure complete removal of the monitoring agent.
Using the Built-in Uninstall Command
The Server Scout agent includes a convenient uninstall command that handles all removal tasks automatically. This is the recommended method for most installations.
Prerequisites
- Root or sudo access to the server
- The server must be running a recent version of the Scout agent
Running the Uninstall Command
- Log in to your server as root or a user with sudo privileges
- Execute the uninstall command:
``bash sudo /opt/scout-agent/scout-agent.sh --uninstall ``
- The system will prompt for confirmation before proceeding. Type
yoryesto confirm the removal
What the Uninstall Process Does
The automated uninstall performs several cleanup tasks:
- Stops the
scout-agentsystemd service immediately - Disables the service to prevent it from starting on boot
- Removes the service file located at
/etc/systemd/system/scout-agent.service - Reloads the systemd daemon to recognise the service removal
- Completely removes the
/opt/scout-agent/directory, including:
- Configuration files - Spool directories - Installed plugins - Agent binaries and scripts
Manual Uninstall Process
If you're running an older version of the Scout agent that doesn't include the --uninstall flag, or if the automated process fails, you can remove the agent manually.
Step-by-Step Manual Removal
- Stop the Scout agent service:
``bash sudo systemctl stop scout-agent ``
- Disable the service to prevent automatic startup:
``bash sudo systemctl disable scout-agent ``
- Remove the systemd service file:
``bash sudo rm /etc/systemd/system/scout-agent.service ``
- Reload the systemd daemon:
``bash sudo systemctl daemon-reload ``
- Remove the entire Scout agent directory:
``bash sudo rm -rf /opt/scout-agent ``
Verifying Complete Removal
After running either the automated or manual uninstall process, it's important to verify that the agent has been completely removed.
Check Service Status
Confirm that the systemd service is no longer recognised:
systemctl status scout-agent
You should see output indicating that the service is not found, such as:
Unit scout-agent.service could not be found.
Verify Directory Removal
Ensure the Scout agent directory has been completely removed:
ls -la /opt/scout-agent
This command should return an error message indicating that the directory doesn't exist:
ls: cannot access '/opt/scout-agent': No such file or directory
Dashboard Considerations
After uninstalling the agent, the server will appear as "offline" in your Server Scout dashboard. This is expected behaviour, as the agent is no longer running to send monitoring data.
Removing the Server from Your Dashboard
The uninstall process only removes the agent from your server—it doesn't automatically delete the server from your Server Scout dashboard. To complete the removal:
- Log in to your Server Scout dashboard at serverscout.ie
- Navigate to your servers list
- Locate the offline server
- Delete the server entry through the web interface
This final step ensures your dashboard remains tidy and accurately reflects your current monitoring setup.
Troubleshooting
If you encounter permission errors during uninstall, ensure you're running the commands with appropriate privileges using sudo. If files seem to persist after removal, double-check that no Scout agent processes are still running with ps aux | grep scout-agent before attempting removal again.
Frequently Asked Questions
How do I uninstall the Server Scout agent from my Linux server?
What happens when I uninstall the Scout agent?
How do I manually remove Scout agent if the uninstall command doesn't work?
How can I verify the Scout agent was completely removed?
What should I do about my server in the ServerScout dashboard after uninstalling?
What if I get permission errors when trying to uninstall Scout agent?
Was this article helpful?