Documentation ¶
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) GetCpuInfo() (cpuInfo *CpuInfo, err error)
- func (c *Client) GetMemInfo() (memInfo *MemInfo, err error)
- func (c *Client) GetNetInfo() (netInfos []*NetInfo, err error)
- func (c *Client) GetPing() (rtt int64, err error)
- func (c *Client) GetSession() (*ssh.Session, error)
- func (c *Client) GetStats() (stats *Stats, err error)
- func (c *Client) GetUptime() (uptime int64, err error)
- func (c *Client) Run(cmd string) (stdout string, err error)
- func (c *Client) RunCmd(cmd string) (stdout string, err error)
- type CpuInfo
- type HostInfo
- type MemInfo
- type NetInfo
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewSSHClient ¶
func (*Client) GetCpuInfo ¶
func (*Client) GetMemInfo ¶
func (*Client) GetNetInfo ¶
type CpuInfo ¶
type CpuInfo struct { Percent float64 `json:"percent"` User float64 `json:"user"` Nice float64 `json:"nice"` System float64 `json:"system"` Idle float64 `json:"idle"` IOWait float64 `json:"iowait"` Irq float64 `json:"irq"` SoftIrq float64 `json:"softIrq"` Steal float64 `json:"steal"` Guest float64 `json:"guest"` Cores uint `json:"cores"` // contains filtered or unexported fields }
CpuInfo cpu信息
type HostInfo ¶
type HostInfo struct { Host string `json:"host"` Port uint16 `json:"port"` Username string `json:"username"` Password string `json:"password"` PrivateKey string `json:"privateKey"` Passphrase string `json:"passphrase"` }
func (*HostInfo) GetAuthMethods ¶
func (h *HostInfo) GetAuthMethods() []ssh.AuthMethod
type MemInfo ¶
type MemInfo struct { Percent float64 `json:"percent"` Total uint64 `json:"total"` Free uint64 `json:"free"` Available uint64 `json:"available"` Buffers uint64 `json:"buffers"` Cached uint64 `json:"cached"` SwapTotal uint64 `json:"swapTotal"` SwapFree uint64 `json:"swapFree"` }
MemInfo 内存信息
type NetInfo ¶
type NetInfo struct { Name string `json:"name"` BytesRec uint64 `json:"bytesRec"` BytesSent uint64 `json:"bytesSent"` SpeedRec uint64 `json:"speedRec"` SpeedSent uint64 `json:"speedSent"` }
NetInfo 网络信息
Click to show internal directories.
Click to hide internal directories.