Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandConfig ¶
type CommandConfig struct { Command string `yaml:"command"` Debug bool `yaml:"debug,omitempty"` Metrics map[string]*MetricConfig `yaml:"metrics"` }
CommandConfig stores command specific configuration
type Config ¶
type Config struct {
Hosts map[string]*HostConfig `yaml:"hosts,omitempty"`
}
Config stores the ssh-exporter's configuration
type HostConfig ¶
type HostConfig struct { Mutex sync.Mutex HostName string Port int `yaml:"port,omitempty"` Username string `yaml:"username"` KeyFile string `yaml:"key_file,omitempty"` Password string `yaml:"password,omitempty"` ConnectTimeout int `yaml:"connect_timeout,omitempty"` CommandTimeout int `yaml:"command_timeout,omitempty"` Commands []*CommandConfig `yaml:"commands"` }
HostConfig stores host specifc configuration
func (*HostConfig) GetSSHAuthMethods ¶
func (host *HostConfig) GetSSHAuthMethods() ([]ssh.AuthMethod, error)
GetSSHAuthMethods returns a list of ssh.AuthMethod for a given host
func (*HostConfig) GetSSHConfig ¶
func (host *HostConfig) GetSSHConfig() (*ssh.ClientConfig, error)
GetSSHConfig returns a ssh.ClientConfig for a given host
type MetricConfig ¶
type MetricConfig struct { Regex string `yaml:"regex"` RegexCompiled *regexp.Regexp Help string `yaml:"help,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` DynamicLabels []string `yaml:"dynamic_labels,omitempty"` ValueAsLabel string `yaml:"value_as_label,omitempty"` ValueEnum []string `yaml:"value_enum,omitempty"` Desc *prometheus.Desc }
MetricConfig stores metrics to extract by regex matching command's stdout
Click to show internal directories.
Click to hide internal directories.