Skip to main content

Get

Get detailed information about a specific process by PID:

$ osapi client node process get --target web-01 --pid 1234

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

HOSTNAME STATUS PID NAME USER STATE CPU% COMMAND
web-01 ok 1234 nginx www sleeping 2.3% nginx: worker process

1 host: 1 ok

When targeting all hosts:

$ osapi client node process get --target _all --pid 1

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

HOSTNAME STATUS PID NAME USER STATE CPU% COMMAND
web-01 ok 1 systemd root sleeping 0.0% /sbin/init
web-02 ok 1 systemd root sleeping 0.0% /sbin/init

2 hosts: 2 ok

JSON Output

Use --json to get the full API response:

$ osapi client node process get --target web-01 --pid 1234 --json
{"results":[{"hostname":"web-01","process":{"pid":1234,"name":"nginx","user":"www","state":"sleeping","cpu_percent":2.3,"mem_percent":1.5,"command":"nginx: worker process"},"status":"ok"}],"job_id":"..."}

Flags

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