Documentation ¶
Overview ¶
Package ssh is the ssh probe package
Index ¶
- Constants
- type BastionMapType
- type Endpoint
- type SSH
- type Server
- func (s *Server) Config(gConf global.ProbeSettings) error
- func (s *Server) Configure(gConf global.ProbeSettings, kind, tag, name, endpoint string, ...) error
- func (s *Server) DoProbe() (bool, string)
- func (s *Server) ExportMetrics()
- func (s *Server) GetSSHClient() error
- func (s *Server) GetSSHClientFromBastion() error
- func (s *Server) RunSSHCmd() (string, error)
- func (s *Server) SetBastion(b *Endpoint)
Constants ¶
View Source
const Kind string = "ssh"
Kind is the type of probe
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BastionMapType ¶
BastionMapType is the type of bastion
var BastionMap BastionMapType
BastionMap is a map of bastion
func (*BastionMapType) ParseAllBastionHost ¶
func (bm *BastionMapType) ParseAllBastionHost()
ParseAllBastionHost parse all bastion host
type Endpoint ¶
type Endpoint struct { PrivateKey string `yaml:"key" json:"key,omitempty" jsonschema:"title=Private Key,description=the private key file path for ssh login"` Passphrase string `yaml:"passphrase" json:"passphrase,omitempty" jsonschema:"title=Passphrase,description=the passphrase for ssh private key"` Host string `yaml:"host" json:"host" jsonschema:"required,format=hostname,title=Host,description=the host for ssh probe"` User string `yaml:"username" json:"username,omitempty" jsonschema:"title=User,description=the username for ssh probe"` Password string `yaml:"password" json:"password,omitempty" jsonschema:"title=Password,description=the password for ssh probe"` // contains filtered or unexported fields }
Endpoint is SSH Endpoint
type SSH ¶
type SSH struct { Bastion *BastionMapType `yaml:"bastion" json:"bastion,omitempty" jsonschema:"title=Bastion Servers,description=the bastion hosts configuration"` Servers []Server `yaml:"servers" json:"servers" jsonschema:"required,title=SSH Servers,description=SSH servers to probe"` }
SSH is the SSH probe Configuration
type Server ¶
type Server struct { base.DefaultProbe `yaml:",inline"` Endpoint `yaml:",inline"` Command string `yaml:"cmd" json:"cmd,omitempty" jsonschema:"title=Shell Command,description=command to run"` Args []string `yaml:"args,omitempty" json:"args,omitempty" jsonschema:"title=Shell Command Arguments,description=arguments for the command"` Env []string `` /* 132-byte string literal not displayed */ // Output Text Checker probe.TextChecker `yaml:",inline"` BastionID string `yaml:"bastion" json:"bastion,omitempty" jsonschema:"title=Bastion Server,description=the bastion host id"` // contains filtered or unexported fields }
Server implements a config for ssh command
func (*Server) Config ¶
func (s *Server) Config(gConf global.ProbeSettings) error
Config SSH Config Object
func (*Server) Configure ¶
func (s *Server) Configure(gConf global.ProbeSettings, kind, tag, name, endpoint string, bastionMap *BastionMapType, fn base.ProbeFuncType) error
Configure configure the SSH probe
func (*Server) GetSSHClient ¶
GetSSHClient returns a ssh.Client
func (*Server) GetSSHClientFromBastion ¶
GetSSHClientFromBastion returns a ssh.Client via bastion server
Click to show internal directories.
Click to hide internal directories.