Documentation
¶
Overview ¶
Package doctor is the node's self-diagnosis: host checks that each come from a real incident, and safe fixes the panel may ask for.
Rules the package keeps:
- Read-only by default. A check only reads /proc, /sys, a few config files and runs read-only commands (systemctl list-*, nft list, timedatectl show, dmesg, journalctl -k). Only Apply changes anything, only for the eight compiled fix ids, never from a string the panel sends (params are validated), and a dry run changes nothing.
- A check that cannot run here (container, no systemd, not root, not Linux) is SKIP with a reason, never a false OK.
- Runs are bounded: every check has its own 10 s budget and the whole run 30 s, output of external commands is capped, a hung or panicking check becomes a SKIP. One run at a time (ErrBusy).
- The package knows nothing about the agent: everything it needs from the agent (inbounds, settings, the stats ring, the clock offset) and from the machine (files, commands, sockets) arrives through Env, so tests run against a fake root directory and fake command runners.
Thresholds are constants in thresholds.go.
Index ¶
- Constants
- Variables
- func CheckIDs() []string
- func FixIDs() []string
- func RecheckIDs(fixID string) []string
- func ResolverTargets(s Settings) []string
- type AwgBackend
- type Container
- type Doctor
- func (d *Doctor) Apply(ctx context.Context, fixID string, dryRun bool, params map[string]string) FixOutcome
- func (d *Doctor) ApplyWithRefreshAck(ctx context.Context, fixID string, dryRun bool, params map[string]string, ...) FixOutcome
- func (d *Doctor) Run(ctx context.Context, ids []string) (*Report, error)
- type Env
- type FSStat
- type FixOutcome
- type Inbound
- type InboundListen
- type OwnedAddr
- type PathFinding
- type Report
- type Result
- type Ring
- type Sample
- type Settings
- type Status
- type WarpInfo
Constants ¶
const ( // disk_space: mount, used_pct, free_mb, inode_pct CodeDiskUsage = "disk_space.usage" CodeDiskUnreadable = "disk_space.unreadable" // journald_size: journal_mb, cap_mb CodeJournalSize = "journald_size.size" CodeJournalNone = "journald_size.none" // dstate_tasks: stuck, tasks CodeDstateNone = "dstate_tasks.none" CodeDstateStuck = "dstate_tasks.stuck" CodeDstateLoadIdle = "dstate_tasks.load_idle" CodeDstateStuckLoad = "dstate_tasks.stuck_load_idle" CodeDstateNoProc = "dstate_tasks.no_proc" CodeDstateCut = "dstate_tasks.interrupted" // time_sync: offset_s, ntp_synced (yes | no | unknown) CodeTimeOffset = "time_sync.offset" // resolver: domains, failed_count, failed, median_ms, p50_ms, p95_ms (lookup timings of the control domains) CodeResolverOK = "resolver.ok" CodeResolverFailed = "resolver.failed" // ipv6: ipv6 (yes | no), connect (ok | failed), warp_inbounds, client_ipv6 (off), suggest (client_ipv6_off); // with a global address also iface (interface of the main-table ::/0 route; never mg*, wg*, awg* or other tunnels), // addrs (its stable global addresses "addr/plen", comma-separated, at most 4) and src (the kernel's source address // for an outbound IPv6 connection); each is omitted when unknown. An agent that holds addresses for the panel adds // owned ("addr=state", comma-separated: ok | missing | tentative | dad_failed | denied); a DAD failure or a missing // or denied one warns (owned_dad_failed, owned_missing) unless the result already warns CodeIPv6None = "ipv6.none" CodeIPv6NoneWarp = "ipv6.none_warp" CodeIPv6OK = "ipv6.ok" CodeIPv6Stalls = "ipv6.connect_failed" CodeIPv6ClientOff = "ipv6.client_off" // outbound IPv6 fails, but "IPv6 for clients" is off: clients use IPv4 CodeIPv6OwnedMissing = "ipv6.owned_missing" CodeIPv6OwnedDADFailed = "ipv6.owned_dad_failed" // foreign_vpn: names, count, on_our_ports CodeVPNNone = "foreign_vpn.none" CodeVPNFound = "foreign_vpn.found" CodeVPNClash = "foreign_vpn.clash" // foreign_nft: table_count, rules, tables, nat_tables, ports CodeNftClean = "foreign_nft.clean" CodeNftFound = "foreign_nft.found" CodeNftNat = "foreign_nft.nat" CodeNftHits = "foreign_nft.hits_ports" CodeNftNone = "foreign_nft.no_nft" CodeNftError = "foreign_nft.unreadable" // port_conflicts: checked, inbound_id, port, network, process, hop_from, hop_to, hop_holders CodePortsOK = "port_conflicts.ok" CodePortsNone = "port_conflicts.none" CodePortsHop = "port_conflicts.hop" CodePortsTLS = "port_conflicts.tls" CodePortsFailedBnd = "port_conflicts.bind_failed" CodePortsHeld = "port_conflicts.held" CodePortsNoTable = "port_conflicts.no_table" // net_baseline: differs, notes (comma separated tokens, see baselineDiff) CodeBaselineOK = "net_baseline.ok" CodeBaselineNotes = "net_baseline.ok_notes" CodeBaselineDiff = "net_baseline.differs" // cert_expiry: checked, reason, days_left, inbound_id, server_name CodeCertOK = "cert_expiry.ok" CodeCertAgent = "cert_expiry.agent" CodeCertInbound = "cert_expiry.inbound" CodeCertUnreadable = "cert_expiry.unreadable" CodeCertNone = "cert_expiry.none" // memory_pressure: avail_pct, swap_pct, oom_kills (a number or "unknown") CodeMemUsage = "memory_pressure.usage" CodeMemNoInfo = "memory_pressure.no_meminfo" // cpu_softirq: softirq_pct, cpu_pct, samples, need CodeCPULoad = "cpu_softirq.load" CodeCPUCollecting = "cpu_softirq.collecting" // cpu_steal: steal_pct (mean), steal_max_pct, samples, need CodeStealLoad = "cpu_steal.load" CodeStealCollecting = "cpu_steal.collecting" // conntrack_fill: count, max, fill_pct CodeConntrackFill = "conntrack_fill.fill" CodeConntrackNotLoaded = "conntrack_fill.not_loaded" // agent_fds: fds, limit, used_pct CodeFDsUsage = "agent_fds.usage" CodeFDsUnknown = "agent_fds.unknown" // kernel_headers: kernel, missing, mode (auto | kernel | userspace), virt CodeHeadersNoAwg = "kernel_headers.no_awg" CodeHeadersContainer = "kernel_headers.container" CodeHeadersReady = "kernel_headers.ready" CodeHeadersUserspace = "kernel_headers.userspace" CodeHeadersOptional = "kernel_headers.optional" CodeHeadersMissing = "kernel_headers.missing" // awg_backend: backend, version, mode, reason, hint CodeAwgNone = "awg_backend.none" CodeAwgNoEngine = "awg_backend.no_engine" CodeAwgRunning = "awg_backend.running" CodeAwgForwardDrop = "awg_backend.forward_drop" // awg_backend.fallback: backend, version, mode, kernel, reason CodeAwgFallback = "awg_backend.fallback" // warp_path: state, backend, colo, inbounds, hint, error CodeWarpNoManager = "warp_path.no_manager" CodeWarpUnused = "warp_path.unused" CodeWarpNoAccount = "warp_path.not_configured" CodeWarpHostClash = "warp_path.host_clash" CodeWarpUp = "warp_path.up" CodeWarpCheckFailed = "warp_path.check_failed" CodeWarpStarting = "warp_path.starting" CodeWarpNoBackend = "warp_path.no_backend" CodeWarpPausedUsed = "warp_path.paused_used" CodeWarpPaused = "warp_path.paused" CodeWarpDown = "warp_path.down" CodeWarpUnknown = "warp_path.unknown_state" // unit_generation: unit_gen, current, reason, from_gen, to_gen CodeUnitCurrent = "unit_generation.current" CodeUnitOutdated = "unit_generation.outdated" CodeUnitManual = "unit_generation.not_systemd" CodeUnitOtherUnit = "unit_generation.other_unit" CodeUnitUnknown = "unit_generation.unknown" CodeUnitRefreshFailed = "unit_generation.refresh_failed" // security_updates: off (raw settings and timer states) CodeSecurityUpdatesOn = "security_updates.on" CodeSecurityUpdatesNotInstalled = "security_updates.not_installed" CodeSecurityUpdatesOff = "security_updates.off" CodeSecurityUpdatesNotAPT = "security_updates.not_apt" CodeSecurityUpdatesNoSystemd = "security_updates.no_systemd" CodeSecurityUpdatesEnabling = "security_updates.enabling" CodeSecurityUpdatesEnableFailed = "security_updates.enable_failed" CodeSecurityUpdatesAutoReboot = "security_updates.auto_reboot" // nftables: reason CodeNftablesOn = "nftables.on" CodeNftablesMissing = "nftables.missing" CodeNftablesInstalling = "nftables.installing" CodeNftablesInstallFailed = "nftables.install_failed" // Any check: why it did not run. skip.unsupported has reason (English, from the host probe). CodeSkipUnsupported = "skip.unsupported" CodeSkipTimeout = "skip.timeout" CodeSkipInternal = "skip.internal" CodeSkipUnknown = "skip.unknown_check" )
Detail codes: the stable name of the fact line of a Result ("<check id>.<variant>", agent.proto DoctorResult.detail_code). The admin UI writes a localized sentence per code from Result.Params (the English Detail stays for logs, old panels and codes the UI does not know). A code is never renamed; add new ones. Params named in the comments are what the sentence of that code uses; numbers are plain decimal strings.
const ( CheckDiskSpace = "disk_space" CheckJournaldSize = "journald_size" CheckDstateTasks = "dstate_tasks" CheckTimeSync = "time_sync" CheckResolver = "resolver" CheckIPv6 = "ipv6" CheckForeignVPN = "foreign_vpn" CheckForeignNft = "foreign_nft" CheckPortConflicts = "port_conflicts" CheckNetBaseline = "net_baseline" CheckCertExpiry = "cert_expiry" CheckMemoryPressure = "memory_pressure" CheckCPUSoftirq = "cpu_softirq" CheckKernelHeaders = "kernel_headers" CheckAwgBackend = "awg_backend" CheckWarpPath = "warp_path" CheckUnitGeneration = "unit_generation" CheckSecurityUpdates = "security_updates" CheckNftables = "nftables" CheckCPUSteal = "cpu_steal" CheckConntrackFill = "conntrack_fill" CheckAgentFDs = "agent_fds" )
Check ids, in the order a full report lists them (agent.proto "CHECK IDS"). Append only.
const ( FixJournaldVacuum = "journald_vacuum" FixApplyBaseline = "apply_baseline" FixRestartInbound = "restart_inbound" FixSetResolver = "set_resolver" FixReconnectWarp = "reconnect_warp" FixRefreshUnit = "refresh_unit" FixAllowForwarding = "allow_forwarding" FixEnableSecurityUpdates = "enable_security_updates" FixAwgModuleRepair = "awg_module_repair" FixInstallNftables = "install_nftables" )
Fix ids (agent.proto "FIX IDS").
const ( ErrUnknownFix = "unknown_fix" ErrBadParams = "bad_params" ErrNotApplicable = "not_applicable" ErrUnsupportedHost = "unsupported_host" ErrFixBusy = "busy" ErrUnitRefreshInvalid = "unit_refresh_invalid" )
The fix vocabulary of CommandResult.error for ApplyFix (agent.proto "DOCTOR").
Variables ¶
var Codes = []string{ CodeDiskUsage, CodeDiskUnreadable, CodeJournalSize, CodeJournalNone, CodeDstateNone, CodeDstateStuck, CodeDstateLoadIdle, CodeDstateStuckLoad, CodeDstateNoProc, CodeDstateCut, CodeTimeOffset, CodeResolverOK, CodeResolverFailed, CodeIPv6None, CodeIPv6NoneWarp, CodeIPv6OK, CodeIPv6Stalls, CodeIPv6ClientOff, CodeIPv6OwnedMissing, CodeIPv6OwnedDADFailed, CodeVPNNone, CodeVPNFound, CodeVPNClash, CodeNftClean, CodeNftFound, CodeNftNat, CodeNftHits, CodeNftNone, CodeNftError, CodePortsOK, CodePortsNone, CodePortsHop, CodePortsTLS, CodePortsFailedBnd, CodePortsHeld, CodePortsNoTable, CodeBaselineOK, CodeBaselineNotes, CodeBaselineDiff, CodeCertOK, CodeCertAgent, CodeCertInbound, CodeCertUnreadable, CodeCertNone, CodeMemUsage, CodeMemNoInfo, CodeCPULoad, CodeCPUCollecting, CodeHeadersNoAwg, CodeHeadersContainer, CodeHeadersReady, CodeHeadersUserspace, CodeHeadersOptional, CodeHeadersMissing, CodeAwgNone, CodeAwgNoEngine, CodeAwgRunning, CodeAwgForwardDrop, CodeAwgUnavailable, CodeAwgFallback, CodeWarpNoManager, CodeWarpUnused, CodeWarpNoAccount, CodeWarpHostClash, CodeWarpUp, CodeWarpCheckFailed, CodeWarpStarting, CodeWarpNoBackend, CodeWarpPausedUsed, CodeWarpPaused, CodeWarpDown, CodeWarpUnknown, CodeUnitCurrent, CodeUnitOutdated, CodeUnitManual, CodeUnitOtherUnit, CodeUnitUnknown, CodeUnitRefreshFailed, CodeSecurityUpdatesOn, CodeSecurityUpdatesNotInstalled, CodeSecurityUpdatesOff, CodeSecurityUpdatesNotAPT, CodeSecurityUpdatesNoSystemd, CodeSecurityUpdatesEnabling, CodeSecurityUpdatesEnableFailed, CodeSecurityUpdatesAutoReboot, CodeNftablesOn, CodeNftablesMissing, CodeNftablesInstalling, CodeNftablesInstallFailed, CodeStealLoad, CodeStealCollecting, CodeConntrackFill, CodeConntrackNotLoaded, CodeFDsUsage, CodeFDsUnknown, CodeSkipUnsupported, CodeSkipTimeout, CodeSkipInternal, CodeSkipUnknown, }
Codes lists every detail code, for the test that keeps the admin UI's wording in step.
var ErrBusy = errors.New("busy")
ErrBusy is returned by Run while another run is in progress.
Functions ¶
func RecheckIDs ¶
RecheckIDs returns the checks to re-run after a fix, nil for an unknown fix id.
func ResolverTargets ¶
ResolverTargets is what set_resolver configures: the usable (IP, optionally host:port) entries of NodeSettings.dns_resolvers, else the default for the country.
Types ¶
type AwgBackend ¶
type AwgBackend struct {
Mode string // what NodeSettings.awg_backend asked: auto | kernel | userspace
Name string // "kernel" | "userspace"; "" when unavailable
Version string
Available bool
// Fallback: mode is "kernel", the module does not load and userspace serves in its place. Reason says why.
Fallback bool
Reason string // when unavailable (or Fallback): a short English fact
}
AwgBackend is the choice of the AmneziaWG backend as the engine made it (awg.BackendStatus).
type Doctor ¶
type Doctor struct {
// contains filtered or unexported fields
}
Doctor runs the checks and the fixes. Create it with New.
func (*Doctor) Apply ¶
func (d *Doctor) Apply(ctx context.Context, fixID string, dryRun bool, params map[string]string) FixOutcome
Apply runs one of the compiled fixes. The id never reaches a shell; params are validated before use. dryRun changes nothing. One fix at a time.
func (*Doctor) ApplyWithRefreshAck ¶ added in v0.1.37
func (d *Doctor) ApplyWithRefreshAck(ctx context.Context, fixID string, dryRun bool, params map[string]string, beforeRefresh func(FixOutcome)) FixOutcome
ApplyWithRefreshAck lets the agent send refresh_unit's CommandResult after systemd-run accepts the gated helper and before the helper is released to restart this service. Other fixes do not call beforeRefresh.
type Env ¶
type Env struct {
// Root is prefixed to every absolute path the checks read (/proc/..., /etc/..., /var/log/...); "" = the
// real root. Commands and syscalls are not redirected: they go through Run, Statfs, ... below.
Root string
// StateDir is the agent state directory; its volume is checked for free space too.
StateDir string
// Virt is systemd-detect-virt style ("kvm", "openvz", "lxc", "none", "unknown", "").
Virt string
// CPUs is the logical CPU count (0 = runtime.NumCPU).
CPUs int
// SelfPID is the agent's pid: sockets it holds are "ours".
SelfPID int
// Unsupported, when non-empty, makes every check SKIP and every fix unsupported_host (not a Linux host).
Unsupported string
// Machine side.
Statfs func(path string) (FSStat, error)
Run func(ctx context.Context, name string, args ...string) ([]byte, error) // stdout; error carries stderr
LookPath func(name string) (string, error)
Readlink func(path string) (string, error) // absolute path, not rooted; nil = os.Readlink under Root
Sleep func(ctx context.Context, d time.Duration)
Now func() time.Time
// Dial is a TCP connect attempt that is closed at once.
Dial func(ctx context.Context, network, addr string) error
// LocalAddr is the source address the kernel picks for a connection to addr: a UDP connect that sends nothing.
LocalAddr func(ctx context.Context, network, addr string) (string, error)
// Lookup resolves host with the host's own resolver; LookupVia asks one server ("ip:port") directly.
Lookup func(ctx context.Context, host string) error
LookupVia func(ctx context.Context, server, host string) error
// ServedCert returns the leaf certificate a TLS listener at addr (host:port) serves for sni.
ServedCert func(ctx context.Context, addr, sni string) (*x509.Certificate, error)
// Docker lists the containers through the read-only socket API; an error means "no docker here".
Docker func(ctx context.Context) ([]Container, error)
// Agent side.
Settings func() Settings
Inbounds func() []Inbound
// OwnedIPv6 are the addresses the agent holds for the panel with the state of each (hostctl.IPv6Addr*); nil = none.
OwnedIPv6 func() []OwnedAddr
// Samples returns the stats ring samples of the last window, oldest first.
Samples func(window time.Duration) []Sample
// Offset is the panel clock minus the local clock in seconds, measured at Hello.
Offset func() int64
AgentCertNotAfter func() time.Time
// OwnIface says an interface was created by the agent (nil = none is).
OwnIface func(name string) bool
// AwgBackend is the choice of the AmneziaWG backend (awg_backend check); nil = this build has no awg engine.
AwgBackend func() AwgBackend
// UnderSystemd says the agent was started by systemd, including an older unit without UnitGen.
UnderSystemd bool
// UnitSkipReason is "other_unit" when systemd owns the process but it is not mistgate-node.service.
UnitSkipReason string
// UnitRefreshBusy checks for an existing refresh job or an update before a no-op or refresh.
UnitRefreshBusy func(context.Context) error
// UnitRefreshReserve excludes update/rollback while the refresh job is started. release(true) leaves the persistent
// marker for the transient helper to clear after the service is healthy; release(false) cancels a failed launch.
UnitRefreshReserve func(context.Context) (release func(started bool), err error)
// LaunchUnitRefresh queues the fixed transient refresh job. beforeLaunch sends the started result after systemd-run
// accepts the job and before the helper's ack file lets it restart this service.
LaunchUnitRefresh func(context.Context, func()) error
// LaunchSecurityUpdates starts the fixed transient root job that installs and enables unattended security updates.
// Nil means this agent cannot launch the job outside its service sandbox.
LaunchSecurityUpdates func(context.Context) error
// LaunchInstallNftables starts the fixed transient root job that installs the nftables package (nftinstall).
// Nil means this agent cannot launch it outside its service sandbox.
LaunchInstallNftables func(context.Context) error
// Warp is the WARP manager's view (warp_path check); nil = this build has no WARP manager.
Warp func(ctx context.Context) WarpInfo
// HostPath lists clashes of the host with the tunnel path (a routing table or rule preference another tool uses, a
// FORWARD drop policy); nil = not checked.
HostPath func(ctx context.Context) []PathFinding
// UnitGen is the generation of the systemd unit the agent runs from (MISTGATE_UNIT_GEN), 0 = unknown or predates the variable.
UnitGen int
// AgentStartedAt lets unit_generation ignore outcomes left by earlier agent processes.
AgentStartedAt time.Time
// Fix actions.
ApplyBaseline func(ctx context.Context) error
RestartInbound func(ctx context.Context, inboundID string) (uint32, error) // "" = every FAILED inbound
ReconnectWarp func(ctx context.Context) (bool, error) // true when a down tunnel was reconnected
RecheckWarp func(ctx context.Context) (checked, thresholdDown bool, err error) // thresholdDown also covers a scheduled check that just crossed the threshold
Fixer hostctl.Fixer // nil = journal/resolver fixes unsupported
ForwardFixer hostctl.ForwardExceptionFixer // nil = the narrow FORWARD exception fix is unsupported
// AwgModuleRepair starts the bounded root repair unit. The agent re-applies inbounds after the unit finishes.
// nil = this build cannot (awg_module_repair is then not offered).
AwgModuleRepair func(ctx context.Context) error
// Set by Run: the previous result of a check.
Prev func(id string) (Result, bool)
// contains filtered or unexported fields
}
Env is everything the checks and fixes use from the outside. Production code gets the machine side from DefaultEnv and fills the agent side; a test points Root at a temp directory and replaces the functions. Nil function fields get defaults (nothing configured, real clock) in New.
func DefaultEnv ¶
func DefaultEnv() Env
DefaultEnv returns the machine side of an Env for this host: real commands (output capped), sockets, resolver and docker socket. The caller fills the agent side (Inbounds, Settings, ...). On a non-Linux host every check is SKIP (Unsupported is set).
type FSStat ¶
type FSStat struct {
BlockSize uint64
Blocks uint64
Bfree uint64
Bavail uint64
Files uint64
Ffree uint64
}
FSStat is what statfs says about a mount.
type FixOutcome ¶
type FixOutcome struct {
OK bool
Affected uint32
Detail string // short English fact line: what would happen / what was done
Params map[string]string
Err string // "" when OK; else one of the Err* words or "failed: <message>"
}
FixOutcome is the answer to Apply; the agent turns it into a CommandResult.
type Inbound ¶
type Inbound struct {
ID string
Protocol string
Network string // "udp" | "tcp"
Port int
SideListens []InboundListen
HopFrom int // 0 = no hop range
HopTo int
Enabled bool
Egress string // "direct" | "warp"
TLSMode string // "acme_domain" | "acme_ip" | "self_signed" | ""
// ServerName is the TLS server name (or IP for acme_ip).
ServerName string
State string // "starting" | "running" | "failed" | "stopped"
Error string // why it is not running
// CertNotAfter is the later of what the engine reported when the inbound was last applied and what it reports now
// (the leaf last handed to a client); zero = unknown. For ACME it can lag a background renewal that no client has
// triggered since, so it is only used when the served certificate cannot be read (a false "expiring" warning is
// the worst case, cleared by the next client).
CertNotAfter time.Time
// TLSPort is the TCP port of the inbound's HTTPS listener (decoy and ACME), 0 = none. The served certificate
// is read there, but only if the listener is ours (see TLSDown and the socket table).
TLSPort int
// TLSDown is why the engine says that listener is not up ("masq_tcp: ... address already in use"), "" = up.
TLSDown string
}
Inbound is one inbound as the doctor sees it.
type InboundListen ¶
InboundListen is an auxiliary socket owned by the inbound, such as TrustTunnel's same-number UDP HTTP/3 listener.
type OwnedAddr ¶ added in v0.1.67
OwnedAddr is one IPv6 address the agent holds for the panel (NodeSettings.ipv6_addresses).
type PathFinding ¶
type PathFinding struct{ ID, Detail string }
PathFinding is one clash of the host with the tunnel path (warp.Finding): "table_in_use" | "rule_pref_in_use" | "interface_in_use" | "forward_drop".
type Report ¶
type Report struct {
Results []Result
Partial bool // only a subset of the checks ran
Duration time.Duration
}
Report is the outcome of Run.
type Result ¶
type Result struct {
ID string
Status Status
// Detail is a short English fact line (at most 200 bytes).
Detail string
// Code names the fact line for the UI (codes.go): it writes the localized sentence from Code and Params.
Code string
// Params fill i18n placeholders; numbers are plain decimal strings, lists are comma separated.
Params map[string]string
// FixID is the fix offered (only with WARN/FAIL); empty = none.
FixID string
Measured time.Time
}
Result is one check's outcome; it becomes one DoctorResult.
type Ring ¶
type Ring struct {
// contains filtered or unexported fields
}
Ring keeps the last ringSize host samples for cpu_softirq, cpu_steal and the idle-load rule. Safe for concurrent use.
type Sample ¶
type Sample struct {
At time.Time
CPU float64 // total busy %
Softirq float64 // softirq %
Load1 float64
// Steal is the share the hypervisor gave to other guests, % (inside CPU).
Steal float64
}
Sample is one stats-interval host sample kept by the agent (Ring).
type Settings ¶
type Settings struct {
Country string // ISO 3166-1 alpha-2, "" = unknown
Resolvers []string // NodeSettings.dns_resolvers
ClientIPv6Disabled bool // NodeSettings.client_ipv6_disabled
}
Settings is the part of NodeSettings the doctor needs.
type Status ¶
type Status int
Status mirrors agent.v1.DoctorStatus (values 1..4), so the agent converts with a plain cast.
type WarpInfo ¶
type WarpInfo struct {
Configured bool // the node has a WarpSpec (paused included)
// State: "none" | "unavailable" | "starting" | "up" | "down" | "disabled" (warp.State.String()).
State string
Backend string
Endpoint string
Colo string
LastError string
LastHandshake time.Time
}
WarpInfo is the WARP manager's view at the time of the check.