Documentation
¶
Overview ¶
Package uptime is the uptime behavior: how long the host has run since it booted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Behavior = behavior.Register(behavior.Define( "uptime", "Get the uptime of target hosts", behavior.Node, behavior.API, behavior.Area(area.Node), behavior.CLI, behavior.Platform(behavior.PlatformLinux, newReader), behavior.Platform(behavior.PlatformDarwin, newReader), behavior.RunsOnPlatform(behavior.PlatformDarwin, "sysctl"), behavior.Read("get", Get). Describe("Get the uptime of the host"). Explain("Reads how long the host has run since it booted: /proc/uptime on Linux, "+ "and the boot time that sysctl gives on macOS. The uptime is in days, hours "+ "and minutes, and in seconds."). Example("A host up for a day, two hours and five minutes", GetInput{}, Entry{Uptime: "1 day, 2 hours, 5 minutes", Seconds: 93900}, behavior.Exists("/proc/uptime", "93900.42 180001.15\n"), behavior.Exists("/proc/stat", "btime 1767229145\n"), behavior.Prints("sysctl -n kern.boottime", "{ sec = 1767229145, usec = 0 } Thu Jan 1 00:59:05 2026"), ), ))
Behavior is the uptime definition. The routes, the agent's dispatch, the CLI commands, the spec, the docs pages and the tests of every layer above the provider are built from it. osapi dsl behavior spec get lists every option.
Functions ¶
This section is empty.