sysreport

package
v3.0.0-rc45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dev

type Dev = uint64

type Mode

type Mode = uint32
type Nlink = uint64

type Sender

type Sender interface {
	// SendSysreport sends the tar archive of the files and command outputs
	// changed since the last report, "" when none changed, and the tracked
	// files deleted, as their path on the node. Full says the archive holds
	// every file and command output the node tracks, for the collector to
	// forget the ones it holds and the archive does not.
	SendSysreport(archive string, deleted []string, full bool) error
}

Sender sends a report to the collector.

type Stat

type Stat struct {
	Path       string `json:"fpath"`    // /opt/opensvc/etc/vcluster.conf
	RealPath   string `json:"realpath"` // /opt/opensvc/etc/vcluster.conf
	Dev        Dev    `json:"dev"`      // 66306
	UID        uint32 `json:"uid"`      // 0
	GID        uint32 `json:"gid"`      // 0
	ModeOctStr string `json:"mode"`     // "0o100600",
	Mode       Mode
	Size       int64
	CTime      timestamp.T `json:"ctime"` // 1640331980
	MTime      timestamp.T `json:"mtime"` // 1640331980
	Nlink      Nlink       `json:"nlink"` // 1
}

Stat contains the metadata of a tracked file

func (Stat) IsEqual

func (t Stat) IsEqual(o Stat) bool

type Stats

type Stats []Stat

Stats is the list of the metadata of all tracked files. The serialized Stats is tracked as a special file, so tracked files metadata changes are also tracked.

func (*Stats) Load

func (t *Stats) Load(r io.Reader) error

func (Stats) Map

func (t Stats) Map() statsMap

func (Stats) Write

func (t Stats) Write(w io.Writer) error

type T

type T struct {
	// contains filtered or unexported fields
}

func New

func New(etcDir, varDir string) *T

New returns a sysreport of the agent installed with its configuration in etcDir and its variable data in varDir: the configuration files of the agent are tracked, and the sysreport.conf.d directory of etcDir says what else to track.

func (*T) Do

func (t *T) Do() error

Do collects the tracked files and command outputs, and reports what changed since the last report the collector accepted.

The local cache records the files as reported when it collects them, before the report is sent: a report the collector does not accept would leave them unreported, and the next report would not see them as changed. So the report is a full one while the sent marker is absent: at the first report, and after one that failed, which removes the marker.

func (*T) SetConfigDir

func (t *T) SetConfigDir(path string)

func (*T) SetConfigReader

func (t *T) SetConfigReader(r io.Reader)

func (*T) SetForce

func (t *T) SetForce(v bool)

func (*T) SetSender

func (t *T) SetSender(sender Sender)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL