Skip to main content

Status

c.Status calls the API's Status group. The status summary of a node.

Methods​

MethodReturnsPermissionDescription
Get(ctx, hostname)*Response[Collection[StatusEntry]]status:readGet the status summary of the host.

Get​

func (s *StatusService) Get(
ctx context.Context,
hostname string,
) (*Response[Collection[StatusEntry]], error)

Get the status summary of the host.

Runs the get of the hostname, uptime, os, load, memory and disk behaviors on the host, and answers with each. A read that fails is in errors, as its name and its error, and the other fields still answer.

It sends GET /api/node/{hostname}/status, and needs the permission status:read.

The examples of the method's definition:

An Ubuntu host, go run status.go get:

resp, err := c.Status.Get(ctx, target)

Types​

The fields of each type are the properties of its schema in the API's spec.

Averages​

FieldTypeDescription
Min15float64The load average over 15 minutes.
Min1float64The load average over 1 minute.
Min5float64The load average over 5 minutes.

Disk​

FieldTypeDescription
FreeintThe bytes free to use.
NamestringWhere the filesystem is mounted.
TotalintThe size of the filesystem in bytes.
UsedintThe bytes in use.

Entry​

FieldTypeDescription
SecondsintHow long the host has run, in seconds.
UptimestringHow long the host has run, in days, hours and minutes.

Release​

FieldTypeDescription
DistributionstringThe distribution, such as ubuntu, or darwin.
VersionstringThe version of the distribution, such as 24.04.

RowStatus​

What happened on the host: ok, the operation ran and succeeded; failed, it ran and did not succeed; skipped, the host's OS family does not support it; timeout, the host did not answer, so nobody knows whether it ran.

A string, one of ok, failed, skipped, timeout.

StatusEntry​

FieldTypeDescription
Disks[]DiskEach local filesystem.
ErrorstringError message if the agent failed.
Errors[]stringEach read that failed, as name: error. The other fields still answer.
HostnamestringHostname of the agent that produced this result.
LoadAverageAverages
MemoryUsage
NamestringThe hostname of the host, as the hostname command prints it.
OSInfoRelease
StatusRowStatusWhat happened on the host: ok, the operation ran and succeeded; failed, it ran and did not succeed; skipped, the host's OS family does not support it; timeout, the host did not answer, so nobody knows whether it ran.
UptimeEntry

Usage​

FieldTypeDescription
FreeintFree memory in bytes.
TotalintTotal memory in bytes.
UsedintUsed memory in bytes: the total less what is available.

Example​

examples/sdk/client/status.go runs each example of this page. With no argument, it lists them.