Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
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.
type T ¶
type T struct {
// contains filtered or unexported fields
}
func New ¶
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 ¶
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.