Skip to main content

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

OptionTypeDefaultDescription
license_keystringrequiredYour PatchCTL license key
api_endpointstringhttps://api.patchctl.comAPI endpoint URL
heartbeat_intervalint300Seconds between heartbeats
log_levelstringinfoLogging verbosity
machine_idstringauto-generatedUnique server identifier

license_key

Your organization's license key, obtained from the dashboard under SettingsAccount.

{
"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
}
Don't Set Too Low

Setting this below 60 seconds may cause rate limiting. The default of 300 seconds is recommended.

log_level

Controls logging verbosity:

LevelDescription
debugVerbose debugging information
infoNormal operational messages
warnWarning conditions
errorError 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"
}
Don't Change

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:

VariableConfig Equivalent
PATCHCTL_LICENSE_KEYlicense_key
PATCHCTL_API_ENDPOINTapi_endpoint
PATCHCTL_LOG_LEVELlog_level
HTTPS_PROXYProxy 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