The Server Scout agent provides several command-line options for configuration, troubleshooting, and management. Whilst the agent typically runs as a systemd service, these options are invaluable during initial setup and ongoing maintenance.
Basic Usage
The agent binary is located at /opt/scout-agent/scout-agent and accepts various flags to control its behaviour:
/opt/scout-agent/scout-agent [options]
Connection Options
Setting the Monitoring Server URL
Use the --url flag to specify your Server Scout monitoring server:
scout-agent --url https://monitor.example.com
This sets the endpoint where the agent will send collected metrics. The URL should include the protocol (https:// or http://).
API Key Authentication
The --key flag accepts your 64-character hexadecimal API key:
scout-agent --key 1a2b3c4d5e6f...
This key authenticates your server with the monitoring platform and must be obtained from your Server Scout dashboard.
Collection Timing
Adjusting Collection Intervals
The --interval option controls how frequently the agent collects metrics:
scout-agent --interval 10
This sets the collection cycle to 10 seconds. The default is 5 seconds. Lower values provide more granular monitoring but increase system overhead.
Metric Configuration
Interactive Configuration Menu
Launch the metric configuration interface with:
scout-agent --configure
This presents an interactive menu allowing you to enable or disable optional metrics such as:
- Extended disk I/O statistics
- Network interface details
- Process monitoring
- Custom application metrics
Changes are saved to the configuration file and apply after the next agent restart.
Operational Commands
Forcing Immediate Collection
To trigger an immediate collection cycle across all monitoring tiers:
scout-agent --refresh
This sends a SIGUSR1 signal to the running agent process, useful for testing configuration changes or obtaining fresh data immediately.
Complete Removal
The --uninstall flag provides complete agent removal:
sudo scout-agent --uninstall
This command:
- Stops the systemd service
- Removes all agent files and directories
- Cleans up configuration files
Root privileges are required, and the system will prompt for confirmation before proceeding.
Environment Variables
As an alternative to command-line flags, you can use environment variables:
| Variable | Equivalent Flag | Description | |----------|----------------|-------------| | MONITORURL | --url | Monitoring server URL | | MONITORKEY | --key | API authentication key | | MONITORINTERVAL | --interval | Collection interval in seconds | | MONITORCONFIG | N/A | Path to configuration file |
Example using environment variables:
export MONITOR_URL="https://monitor.example.com"
export MONITOR_KEY="1a2b3c4d5e6f..."
export MONITOR_INTERVAL="10"
scout-agent
Configuration Files
The agent uses two primary configuration files:
Main Configuration
Location: /opt/scout-agent/scout.conf
Contains metric collection settings, enabled modules, and operational parameters set through the --configure option.
Environment Configuration
Location: /opt/scout-agent/agent.env
Stores environment variables including connection details and collection intervals. This file is sourced by the systemd service.
Service Integration
The agent typically runs as a systemd service called scout-agent. When using command-line options for configuration, remember to:
- Stop the service before making changes
- Update the environment file if needed
- Restart the service to apply new settings
sudo systemctl stop scout-agent
sudo systemctl start scout-agent
sudo systemctl status scout-agent
Troubleshooting Usage
Command-line options are particularly useful when diagnosing issues:
- Use
--urland--keyto test connectivity with different credentials - Employ
--interval 1for high-frequency debugging - Run
--refreshto verify the agent responds to signals - Execute
--configureto review current metric settings
These options provide the flexibility needed for effective server monitoring whilst maintaining the simplicity of automated service operation.
Frequently Asked Questions
How do I set up the ServerScout agent with my monitoring server URL?
What command-line options are available for the ServerScout agent?
How do I troubleshoot ServerScout agent connection issues?
How does the ServerScout agent metric collection interval work?
What environment variables can I use instead of command-line flags?
How do I completely uninstall the ServerScout agent?
How do I configure which metrics the ServerScout agent collects?
Was this article helpful?