Documentation
¶
Overview ¶
Package host is the host probe package
Index ¶
- Constants
- Variables
- type CPU
- type Host
- type Info
- type Server
- func (s *Server) CheckThreshold(info Info) (bool, string)
- func (s *Server) Config(gConf global.ProbeSettings) error
- func (s *Server) DoProbe() (bool, string)
- func (s *Server) ExportCPUMetrics(info *Info)
- func (s *Server) ExportDiskMetrics(info *Info)
- func (s *Server) ExportMemoryMetrics(info *Info)
- func (s *Server) ExportMetrics(info *Info)
- func (s *Server) ParseHostInfo(str string) (Info, error)
- type Threshold
- type Usage
Constants ¶
View Source
const ( DefaultCPUThreshold = 0.8 DefaultMemThreshold = 0.8 DefaultDiskThreshold = 0.95 )
Default threshold
Variables ¶
View Source
var BastionMap ssh.BastionMapType
BastionMap is a map of bastion
Functions ¶
This section is empty.
Types ¶
type CPU ¶
type CPU struct {
User float64 `yaml:"user"`
Sys float64 `yaml:"sys"`
Nice float64 `yaml:"nice"`
Idle float64 `yaml:"idle"`
Wait float64 `yaml:"wait"`
Hard float64 `yaml:"hard"`
Soft float64 `yaml:"soft"`
Steal float64 `yaml:"steal"`
}
CPU is the cpu usage "1.6 us, 1.6 sy, 3.2 ni, 91.9 id, 1.6 wa, 0.0 hi, 0.0 si, 0.0 st"
type Host ¶
type Host struct {
Bastion *ssh.BastionMapType `` /* 129-byte string literal not displayed */
Servers []Server `yaml:"servers" json:"servers" jsonschema:"required,title=Host Servers,description=the host servers to be monitored"`
}
Host is the host probe configuration
type Info ¶
type Info struct {
HostName string `yaml:"hostname"`
OS string `yaml:"os"`
Core int64 `yaml:"core"`
CPU CPU `yaml:"cpu"`
Memory Usage `yaml:"memory"`
Disks []Usage `yaml:"disks"`
}
Info is the host probe information
type Server ¶
type Server struct {
ssh.Server `yaml:",inline"`
Threshold Threshold `` /* 141-byte string literal not displayed */
Disks []string `` /* 135-byte string literal not displayed */
// contains filtered or unexported fields
}
Server is the server of a host probe
func (*Server) CheckThreshold ¶
CheckThreshold check the threshold
func (*Server) Config ¶
func (s *Server) Config(gConf global.ProbeSettings) error
Config is the host probe configuration
func (*Server) ExportCPUMetrics ¶ added in v1.5.0
ExportCPUMetrics export the cpu metrics
func (*Server) ExportDiskMetrics ¶ added in v1.5.0
ExportDiskMetrics export the disk metrics
func (*Server) ExportMemoryMetrics ¶ added in v1.5.0
ExportMemoryMetrics export the memory metrics
func (*Server) ExportMetrics ¶ added in v1.5.0
ExportMetrics export the metrics
type Threshold ¶
type Threshold struct {
CPU float64 `yaml:"cpu,omitempty" json:"cpu,omitempty" jsonschema:"title=CPU threshold,description=CPU threshold (default: 0.8)"`
Mem float64 `yaml:"mem,omitempty" json:"mem,omitempty" jsonschema:"title=Memory threshold,description=Memory threshold (default: 0.8)"`
Disk float64 `yaml:"disk,omitempty" json:"disk,omitempty" jsonschema:"title=Disk threshold,description=Disk threshold (default: 0.95)"`
}
Threshold is the threshold of a probe
Click to show internal directories.
Click to hide internal directories.