Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Partition
- type RaidData
- type Snapshot
- func (s *Snapshot) GetCPUSample(ctx context.Context, run bool) error
- func (s *Snapshot) GetLocalData(ctx context.Context, run bool) (errs []error)
- func (s *Snapshot) GetMemoryUsage(ctx context.Context, run bool) error
- func (s *Snapshot) GetSynology(run bool) error
- func (s *Snapshot) GetUsers(ctx context.Context) error
- type Synology
Constants ¶
View Source
const SynologyConf = "/etc/synoinfo.conf"
Variables ¶
View Source
var ( ErrPlatformUnsup = fmt.Errorf("the requested metric is not available on this platform, " + "if you know how to collect it, please open an issue on the github repo") ErrNonZeroExit = fmt.Errorf("cmd exited non-zero") )
Errors this package generates.
View Source
var ErrNoDisks = fmt.Errorf("no disks found")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Timeout cnfg.Duration `toml:"timeout" xml:"timeout"` // total run time allowed. Interval cnfg.Duration `toml:"interval" xml:"interval"` // how often to send snaps (cron). ZFSPools []string `toml:"zfs_pools" xml:"zfs_pool"` // zfs pools to monitor. UseSudo bool `toml:"use_sudo" xml:"use_sudo"` // use sudo for smartctl commands. Raid bool `toml:"monitor_raid" xml:"monitor_raid"` // include mdstat and/or megaraid. DriveData bool `toml:"monitor_drives" xml:"monitor_drives"` // smartctl commands. DiskUsage bool `toml:"monitor_space" xml:"monitor_space"` // get disk usage. Uptime bool `toml:"monitor_uptime" xml:"monitor_uptime"` // all system stats. CPUMem bool `toml:"monitor_cpuMemory" xml:"monitor_cpuMemory"` // cpu perct and memory used/free. CPUTemp bool `toml:"monitor_cpuTemp" xml:"monitor_cpuTemp"` // not everything supports temps. // contains filtered or unexported fields }
Config determines which checks to run, etc.
func (*Config) GetSnapshot ¶
GetSnapshot returns a system snapshot based on requested data in the config.
type Partition ¶
type Partition struct { Device string `json:"name"` Total uint64 `json:"total"` Free uint64 `json:"free"` }
Partition is used for ZFS pools as well as normal Disk arrays.
type RaidData ¶
type RaidData struct { MDstat string `json:"mdstat,omitempty"` MegaCLI map[string]string `json:"megacli,omitempty"` }
RaidData contains raid information from mdstat and/or megacli.
type Snapshot ¶
type Snapshot struct { Version string Uptime time.Duration System struct { *host.InfoStat Username string `json:"username"` CPU float64 `json:"cpuPerc"` MemFree uint64 `json:"memFree"` MemUsed uint64 `json:"memUsed"` MemTotal uint64 `json:"memTotal"` Temps map[string]float64 `json:"temperatures,omitempty"` Users int `json:"users"` *load.AvgStat } `json:"system"` Raid *RaidData `json:"raid,omitempty"` DriveAges map[string]int `json:"driveAges,omitempty"` DriveTemps map[string]int `json:"driveTemps,omitempty"` DiskUsage map[string]*Partition `json:"diskUsage,omitempty"` DiskHealth map[string]string `json:"driveHealth,omitempty"` ZFSPool map[string]*Partition `json:"zfsPools,omitempty"` // contains filtered or unexported fields }
Snapshot is the output data sent to Notifiarr.
func (*Snapshot) GetCPUSample ¶
func (*Snapshot) GetLocalData ¶
func (*Snapshot) GetMemoryUsage ¶
func (*Snapshot) GetSynology ¶
Click to show internal directories.
Click to hide internal directories.