Agent Configuration
The PatchCTL agent is configured via a JSON file at /etc/patchctl/config.json.
Configuration File
Location
/etc/patchctl/config.json
Default Configuration
{
"license_key": "YOUR_LICENSE_KEY",
"api_endpoint": "https://api.patchctl.com",
"heartbeat_interval": 300,
"log_level": "info"
}
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
license_key | string | required | Your PatchCTL license key |
api_endpoint | string | https://api.patchctl.com | API endpoint URL |
heartbeat_interval | int | 300 | Seconds between heartbeats |
log_level | string | info | Logging verbosity |
machine_id | string | auto-generated | Unique server identifier |
license_key
Your organization's license key, obtained from the dashboard under Settings → Account.
{
"license_key": "pk_live_abc123..."
}
api_endpoint
The PatchCTL API URL. Only change this if directed by support or for testing.
{
"api_endpoint": "https://api.patchctl.com"
}
heartbeat_interval
How often (in seconds) the agent checks in with the API. Default is 300 seconds (5 minutes).
{
"heartbeat_interval": 300
}
Setting this below 60 seconds may cause rate limiting. The default of 300 seconds is recommended.
log_level
Controls logging verbosity:
| Level | Description |
|---|---|
debug | Verbose debugging information |
info | Normal operational messages |
warn | Warning conditions |
error | Error conditions only |
{
"log_level": "info"
}
machine_id
A unique identifier for this server. Auto-generated on first run if not specified.
{
"machine_id": "550e8400-e29b-41d4-a716-446655440000"
}
Changing the machine_id will cause the server to appear as a new server in the dashboard.
Environment Variables
Some settings can also be configured via environment variables:
| Variable | Config Equivalent |
|---|---|
PATCHCTL_LICENSE_KEY | license_key |
PATCHCTL_API_ENDPOINT | api_endpoint |
PATCHCTL_LOG_LEVEL | log_level |
HTTPS_PROXY | Proxy for API requests |
Environment variables take precedence over the config file.
Proxy Configuration
Via Environment
Add to the systemd service file:
[Service]
Environment="HTTPS_PROXY=http://proxy.example.com:8080"
Environment="NO_PROXY=localhost,127.0.0.1"
Then reload:
sudo systemctl daemon-reload
sudo systemctl restart patchctl
Via System Environment
Add to /etc/environment:
HTTPS_PROXY=http://proxy.example.com:8080
NO_PROXY=localhost,127.0.0.1
Applying Configuration Changes
After modifying the configuration:
# Restart the agent to apply changes
sudo systemctl restart patchctl
# Verify the agent started successfully
sudo systemctl status patchctl
Viewing Current Configuration
# View config file
sudo cat /etc/patchctl/config.json
# View effective configuration (from logs)
sudo journalctl -u patchctl | grep "Configuration loaded"
Configuration Security
The config file contains your license key and should be protected:
# Set proper permissions
sudo chmod 600 /etc/patchctl/config.json
sudo chown root:root /etc/patchctl/config.json
# Verify permissions
ls -la /etc/patchctl/config.json
# Should show: -rw------- 1 root root