Skip to main content

Action Reference

Runbooks use 10 typed actions. Each action has a fixed risk tier, defined parameters, and structured output. No shell execution is allowed -- every operation goes through a typed handler.

Action Summary

ActionRiskDescription
refresh_inventoryread_onlyTrigger immediate inventory collection
read_file_tailread_onlyRead the last N lines of a file
read_file_headread_onlyRead the first N lines of a file
restart_systemd_unitoperationalRestart a systemd service
reload_service_configoperationalReload a systemd service configuration
clear_journal_logsoperationalVacuum journald logs by age
run_healthcheckoperationalTrigger a Proxima healthcheck run
rotate_log_filedestructiveCopy and truncate a log file
stop_systemd_unitdestructiveStop a systemd service
kill_processdestructiveSend a signal to a process by name

Read-Only Actions

refresh_inventory

Triggers an immediate inventory collection cycle on the agent.

Parameters: None

Returns:

FieldTypeDescription
statusstringAlways "completed" on success

Example:

- id: refresh
name: "Refresh host inventory"
action: refresh_inventory

read_file_tail

Reads the last N lines of a file. The file path must match the agent's read allowlist.

Parameters:

NameTypeRequiredDefaultConstraintsDescription
pathstringYes--Must be absolute, no .., must match read allowlistFile path
linesintNo100min: 1, max: 1000Number of lines to read

Default read allowlist: /var/log/**, /etc/**, /opt/*/logs/**, /tmp/proxima-*

Returns:

FieldTypeDescription
pathstringThe file path that was read
lines_readintNumber of lines actually returned
contentstringThe file content

Example:

- id: check_syslog
name: "Check recent syslog"
action: read_file_tail
params:
path: "/var/log/syslog"
lines: 50

read_file_head

Reads the first N lines of a file. Same allowlist rules as read_file_tail.

Parameters:

NameTypeRequiredDefaultConstraintsDescription
pathstringYes--Must be absolute, no .., must match read allowlistFile path
linesintNo100min: 1, max: 1000Number of lines to read

Returns:

FieldTypeDescription
pathstringThe file path that was read
lines_readintNumber of lines actually returned
contentstringThe file content

Example:

- id: check_config
name: "Read nginx config header"
action: read_file_head
params:
path: "/etc/nginx/nginx.conf"
lines: 30

Operational Actions

restart_systemd_unit

Restarts a systemd unit and reports its new status.

Parameters:

NameTypeRequiredConstraintsDescription
unitstringYesPattern: ^[[email protected]]+$Systemd unit name (e.g., nginx.service)

Returns:

FieldTypeDescription
unitstringThe unit name
actionstring"restart"
outputstringsystemctl output
statusstringPost-restart status from systemctl is-active

Example:

- id: restart_nginx
name: "Restart nginx"
action: restart_systemd_unit
params:
unit: nginx.service

reload_service_config

Reloads a systemd unit's configuration without a full restart.

Parameters:

NameTypeRequiredConstraintsDescription
unitstringYesPattern: ^[[email protected]]+$Systemd unit name

Returns:

FieldTypeDescription
unitstringThe unit name
actionstring"reload"
outputstringsystemctl output
statusstringPost-reload status from systemctl is-active

Example:

- id: reload_nginx
name: "Reload nginx config"
action: reload_service_config
params:
unit: nginx.service

clear_journal_logs

Vacuums journald logs older than the specified time period.

Parameters:

NameTypeRequiredAllowed ValuesDescription
vacuum_timeenumYes1d, 3d, 7d, 14d, 30dRetention period

Returns:

FieldTypeDescription
vacuum_timestringThe time period used
outputstringjournalctl output (includes freed space)

Example:

- id: clean_logs
name: "Vacuum journal logs older than 7 days"
action: clear_journal_logs
params:
vacuum_time: "7d"

run_healthcheck

Triggers an on-demand Proxima healthcheck run on the agent.

Parameters: None

Returns:

FieldTypeDescription
statusstringAlways "completed" on success

Example:

- id: healthcheck
name: "Run healthcheck"
action: run_healthcheck
on_failure: warn

Destructive Actions

rotate_log_file

Copies the file to {path}.1 and truncates the original to zero bytes. The file path must match the agent's write allowlist.

Parameters:

NameTypeRequiredConstraintsDescription
pathstringYesMust be absolute, no .., must match write allowlistLog file path

Default write allowlist: /var/log/**, /opt/*/logs/**

Returns:

FieldTypeDescription
pathstringThe original file path
old_size_bytesintSize of the file before rotation
rotated_tostringPath of the rotated copy ({path}.1)

Example:

- id: rotate
name: "Rotate application log"
action: rotate_log_file
params:
path: "/var/log/myapp/access.log"

stop_systemd_unit

Stops a systemd unit.

Parameters:

NameTypeRequiredConstraintsDescription
unitstringYesPattern: ^[[email protected]]+$Systemd unit name

Returns:

FieldTypeDescription
unitstringThe unit name
actionstring"stop"
outputstringsystemctl output
statusstringPost-stop status from systemctl is-active

Example:

- id: stop_service
name: "Stop problematic service"
action: stop_systemd_unit
params:
unit: "{{ service }}"

kill_process

Sends a signal to a process identified by exact name match (via pgrep -x). The process must be unambiguous (exactly one PID match).

Parameters:

NameTypeRequiredDefaultConstraintsDescription
namestringYes--Pattern: ^[a-zA-Z0-9_.-]+$Process name
signalenumNoSIGTERMSIGTERM, SIGKILL, SIGHUP, SIGUSR1, SIGUSR2Signal to send

Protected processes (cannot be killed): init, systemd, sshd, proxima-agent, nats-server

Returns:

FieldTypeDescription
namestringThe process name
pidintThe PID that was signaled
signalstringThe signal that was sent
statusstring"signal_sent"

Example:

- id: kill_worker
name: "Kill stuck worker process"
action: kill_process
params:
name: myapp-worker
signal: SIGTERM

File Allowlists

File-based actions (read_file_tail, read_file_head, rotate_log_file) enforce path allowlists to prevent unauthorized file access.

AllowlistDefault PatternsUsed By
Read/var/log/**, /etc/**, /opt/*/logs/**, /tmp/proxima-*read_file_tail, read_file_head
Write/var/log/**, /opt/*/logs/**rotate_log_file

Allowlists can be updated via remote agent configuration. Patterns use glob syntax with ** for recursive directory matching. All paths must be absolute and cannot contain ...

Browsing Actions

The action catalog is available via the API at GET /api/v1/runbooks/actions. This returns all 10 actions with their parameters and risk tiers. The runbook editor uses this endpoint to populate the action dropdown.