Built-in Plugins vs Custom Plugins
Server Scout includes several built-in plugins that are automatically managed for you. The cPanel, DirectAdmin, Plesk, JetBackup, and devices plugins are included with the agent installation and update automatically alongside the agent itself. You don't need to do anything to deploy or maintain these standard plugins.
This guide focuses specifically on deploying custom plugins that you've developed or obtained from third-party sources. Custom plugins require manual deployment and management across your server infrastructure.
Custom Plugin Deployment Basics
Custom plugins must be placed in the /opt/scout-agent/plugins.d/ directory on each server where you want them to run. The plugin file should be executable and follow the Server Scout plugin format.
Here's the basic deployment process:
- Copy your custom plugin script to
/opt/scout-agent/plugins.d/ - Set executable permissions:
chmod +x /opt/scout-agent/plugins.d/your-plugin.sh - Restart the scout-agent service:
systemctl restart scout-agent
For a single server, this is straightforward. However, managing custom plugins across multiple servers requires a more systematic approach.
Configuration Management Deployment
The most robust approach for managing plugins across multiple servers is to use configuration management tools like Ansible, Puppet, Chef, or Salt. These tools ensure consistent deployment and make updates much simpler.
Ansible Example
Here's a simple Ansible playbook task for deploying a custom plugin:
- name: Deploy Server Scout custom plugin
hosts: monitored_servers
tasks:
- name: Copy custom plugin
copy:
src: files/my-custom-plugin.sh
dest: /opt/scout-agent/plugins.d/my-custom-plugin.sh
owner: root
group: root
mode: '0755'
notify: restart scout-agent
- name: Restart scout-agent service
systemd:
name: scout-agent
state: restarted
when: plugin_file.changed
handlers:
- name: restart scout-agent
systemd:
name: scout-agent
state: restarted
This approach ensures the plugin is deployed consistently across all your servers and handles the service restart automatically.
Shell Script Deployment
For simpler environments or one-off deployments, you can use a shell script to deploy plugins across multiple servers:
#!/bin/bash
PLUGIN_FILE="my-custom-plugin.sh"
SERVERS=("server1.example.com" "server2.example.com" "server3.example.com")
for server in "${SERVERS[@]}"; do
echo "Deploying plugin to $server..."
# Copy plugin file
scp "$PLUGIN_FILE" root@"$server":/opt/scout-agent/plugins.d/
# Set permissions and restart agent
ssh root@"$server" "chmod +x /opt/scout-agent/plugins.d/$PLUGIN_FILE && systemctl restart scout-agent"
echo "Deployment to $server completed"
done
Make sure you have SSH key authentication configured for seamless deployment.
Version Management
To track plugin versions across your infrastructure, include a version comment at the top of your custom plugins:
#!/bin/bash
# Plugin: My Custom Plugin
# Version: 1.2.3
# Description: Monitors custom application metrics
After deployment, check the agent logs to verify the plugin loaded successfully:
journalctl -u scout-agent | grep plugin
You should see messages indicating the plugin was loaded during the agent restart.
Updating Custom Plugins
To update a custom plugin, follow the same deployment process:
- Update your plugin file with the new version
- Deploy using your chosen method (configuration management or shell script)
- Restart the scout-agent service on each server
The new version will be active immediately after the agent restarts.
Rollback Strategy
If a plugin update causes issues, you can quickly rollback:
Option 1: Deploy Previous Version Use the same deployment process to install the previous working version of the plugin.
Option 2: Disable the Plugin Add the following line to /opt/scout-agent/scout.conf on affected servers:
plugin_<plugin_name>=0
Then restart the scout-agent service. This disables the plugin without removing the file.
Best Practices
- Always test custom plugins on a development server before deploying to production
- Keep backup copies of working plugin versions
- Use configuration management tools for consistent deployment
- Monitor agent logs after deployment to catch any issues early
- Document your custom plugins and maintain version history
Remember, this deployment process only applies to custom plugins. The built-in Server Scout plugins handle updates automatically as part of the agent's self-update mechanism.
Frequently Asked Questions
How do I deploy custom plugins to multiple Server Scout agents?
What's the difference between built-in and custom Server Scout plugins?
How do I troubleshoot failed plugin deployments?
Can I rollback a custom plugin update if it causes issues?
What's the best way to manage plugin versions across servers?
Do I need to use Ansible for plugin deployment automation?
How do I verify a custom plugin deployed successfully?
Was this article helpful?