Skip to main content

List

List all OSAPI-managed sysctl parameters on a target host:

$ osapi client node sysctl list --target web-01

Job ID: 550e8400-e29b-41d4-a716-446655440000

KEY VALUE
net.ipv4.ip_forward 1
vm.swappiness 10
kernel.panic 30

Target all hosts to list parameters across the fleet:

$ osapi client node sysctl list --target _all

Job ID: 550e8400-e29b-41d4-a716-446655440000

web-01
KEY VALUE
net.ipv4.ip_forward 1
vm.swappiness 10

web-02
KEY VALUE
net.ipv4.ip_forward 1
vm.swappiness 10

Target by label to list parameters on a group of servers:

$ osapi client node sysctl list --target group:web

JSON Output

Use --json to get the full API response:

$ osapi client node sysctl list --target web-01 --json
{"results":[{"hostname":"web-01","key":"net.ipv4.ip_forward","value":"1","status":"ok"}],"job_id":"..."}

Flags

FlagDescriptionDefault
-T, --targetTarget: _any, _all, hostname, or label (group:web)_any
-j, --jsonOutput raw JSON response