Skip to main content

Memory

Get the memory usage of target hosts. osapi behavior get --name memory and osapi behavior method get show the same.

Behavior​

Namememory
DescriptionGet the memory usage 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}/memorymemory:readGet the memory usage of the host

Types (1)​

NAMEINPUTOUTPUT
getGetInputEntry { memory }

Settings (0)​

None. Declare them with behavior.Config.

Telemetry​

Spanbehavior.memory.<method>
Child spansexec sysctl, exec vm_stat
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 memory usage of the host
DetailReads the total, the free and the used memory, in bytes. Used is the total less what is available, which includes the cache, as free(1) reports it.
HTTPGET
Route/api/node/{hostname}/memory
Permissionmemory:read
Commandosapi client node memory get
Input typeGetInput
Output typeEntry

Input (0)​

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

Output (1)​

FIELDTYPEDESCRIPTION
memoryobjectThe memory of the host

Examples (1)​

EXAMPLEINPUTOUTPUT
A host with 8 GiB, 2 GiB of it free(none)memory=map[free:2.147483648e+09 total:8.589934592e+09 used:4.294967296e+09]