Documentation ¶
Overview ¶
Package snmp_exporter embeds https://github.com/prometheus/snmp_exporter
Index ¶
- Variables
- func Handler(w http.ResponseWriter, r *http.Request, logger log.Logger, ...)
- func LoadSNMPConfig(snmpConfigFile string, snmpCfg *snmp_config.Config) (*snmp_config.Config, error)
- func New(log log.Logger, c *Config) (integrations.Integration, error)
- func NewSNMPMetrics(reg prometheus.Registerer) collector.Metrics
- type Config
- type Integration
- type SNMPTarget
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{ WalkParams: make(map[string]snmp_config.WalkParams), SnmpConfigFile: "", SnmpTargets: make([]SNMPTarget, 0), SnmpConfig: snmp_config.Config{}, }
DefaultConfig holds the default settings for the snmp_exporter integration.
Functions ¶
func Handler ¶
func Handler(w http.ResponseWriter, r *http.Request, logger log.Logger, snmpCfg *snmp_config.Config, targets []SNMPTarget, wParams map[string]snmp_config.WalkParams)
func LoadSNMPConfig ¶
func LoadSNMPConfig(snmpConfigFile string, snmpCfg *snmp_config.Config) (*snmp_config.Config, error)
LoadSNMPConfig loads the SNMP configuration from the given file. If the file is empty, it will load the embedded configuration.
func New ¶
func New(log log.Logger, c *Config) (integrations.Integration, error)
New creates a new snmp_exporter integration
func NewSNMPMetrics ¶
func NewSNMPMetrics(reg prometheus.Registerer) collector.Metrics
Types ¶
type Config ¶
type Config struct { WalkParams map[string]snmp_config.WalkParams `yaml:"walk_params,omitempty"` SnmpConfigFile string `yaml:"config_file,omitempty"` SnmpTargets []SNMPTarget `yaml:"snmp_targets"` SnmpConfig snmp_config.Config `yaml:"snmp_config,omitempty"` }
Config configures the SNMP integration.
func (*Config) InstanceKey ¶
InstanceKey returns the hostname:port of the agent.
func (*Config) NewIntegration ¶
func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error)
NewIntegration creates a new SNMP integration.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler for Config.
type Integration ¶
type Integration struct {
// contains filtered or unexported fields
}
Integration is the SNMP integration. The integration scrapes metrics from the host Linux-based system.
func (*Integration) MetricsHandler ¶
func (i *Integration) MetricsHandler() (http.Handler, error)
MetricsHandler implements Integration.
func (*Integration) Run ¶
func (i *Integration) Run(ctx context.Context) error
Run satisfies Integration.Run.
func (*Integration) ScrapeConfigs ¶
func (i *Integration) ScrapeConfigs() []config.ScrapeConfig
ScrapeConfigs satisfies Integration.ScrapeConfigs.
type SNMPTarget ¶
type SNMPTarget struct { Name string `yaml:"name"` Target string `yaml:"address"` Module string `yaml:"module"` Auth string `yaml:"auth"` WalkParams string `yaml:"walk_params,omitempty"` SNMPContext string `yaml:"snmp_context,omitempty"` Labels map[string]string }
SNMPTarget defines a target device to be used by the integration.