Skip to main content

OS

Get the operating system of target hosts. osapi behavior get --name os and osapi behavior method get show the same.

Behavior​

Nameos
DescriptionGet the operating system of target hosts
Placementnode
Internalno
APIyes
CLIyes
Nextno
Platformslinux, darwin
Sudonone
Runsnone
Writesnone
Keeps stateno
Usesnone
Used bystatus

Methods (1)​

NAMEVERBHTTPROUTEPERMISSIONDESCRIPTION
getreadGET/api/node/{hostname}/osos:readGet the operating system of the host

Types (1)​

NAMEINPUTOUTPUT
getGetInputEntry { os_info }

Settings (0)​

None. Declare them with behavior.Config.

Telemetry​

Spanbehavior.os.<method>
Child spansexec sw_vers
Metricsosapi_behavior_calls_total, osapi_behavior_duration_seconds, osapi_behavior_changes_total
Attributesosapi.behavior.name, osapi.behavior.method, osapi.behavior.verb, osapi.behavior.outcome, osapi.behavior.changed
Recorded inputsnone

Method get​

Nameget
Verbread
DescriptionGet the operating system of the host
DetailReads the distribution and its version: the ID and VERSION_ID of /etc/os-release on Linux, and darwin with the ProductVersion of sw_vers on macOS, such as darwin 15.5.
HTTPGET
Route/api/node/{hostname}/os
Permissionos:read
Commandosapi client node os get
Input typeGetInput
Output typeEntry

Input (0)​

None. The method takes no input; its command needs only --target.

Output (1)​

FIELDTYPEDESCRIPTION
os_infoobjectThe operating system

Examples (2)​

EXAMPLEINPUTOUTPUT
An Ubuntu host(none)os_info=map[distribution:ubuntu version:24.04]
A Mac(none)os_info=map[distribution:darwin version:15.5]