configReader

package
v0.0.0-...-7d9df4a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ModeSingle option in mode of metric
	ModeSingle = "single"

	//ModeWalk option in mode of metric
	ModeWalk = "walk"

	//ModeTable option in mode of metric
	ModeTable = "table"

	//nsSourceSNMP option in source of namespace element configuration
	NsSourceSNMP = "snmp"

	//nsSourceString option in source of namespace element configuration
	NsSourceString = "string"

	//nsSourceIndex option in source of namespace element configuration
	NsSourceIndex = "index"
)

Variables

View Source
var (
	//AgentConfigParameters slice of agent configuration parameters
	SnmpAgentConfigParameters = []string{agentName, agentAddress, agentSnmpVersion, agentCommunity, agentNetwork,
		agentUserName, agentSecurityLevel, agentAuthPassword, agentAuthProtocol, agentPrivPassword,
		agentPrivProtocol, agentSecurityEngineId, agentContextEngineID, agentContextName, agentRetries, agentTimeout}
)

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Mode        string      `json:"mode"`
	Namespace   []Namespace `json:"namespace"`
	Oid         string      `json:"OID"`
	Unit        string      `json:"unit"`
	Description string      `json:"description"`
	Shift       float64     `json:"shift"`
	Scale       float64     `json:"scale"`
}

type Metrics

type Metrics []Metric

func GetMetricsConfig

func GetMetricsConfig(setFilePath string) (Metrics, error)

GetMetricsConfig reads and validates configuration of metrics

type Namespace

type Namespace struct {
	Source      string `json:"source"`
	Name        string `json:"name"`
	String      string `json:"string"`
	OidPart     uint   `json:"oid_part"`
	Oid         string `json:"OID"`
	Description string `json:"description"`
	Values      []string
}

type SnmpAgent

type SnmpAgent struct {
	Name             string `mapstructure:"snmp_agent_name"`
	SnmpVersion      string `mapstructure:"snmp_version"`
	Address          string `mapstructure:"snmp_agent_address"`
	Community        string `mapstructure:"community"`
	Network          string `mapstructure:"network"`
	UserName         string `mapstructure:"user_name"`
	SecurityLevel    string `mapstructure:"security_level"`
	AuthPassword     string `mapstructure:"auth_password"`
	AuthProtocol     string `mapstructure:"auth_protocol"`
	PrivPassword     string `mapstructure:"priv_password"`
	PrivProtocol     string `mapstructure:"priv_protocol"`
	SecurityEngineId string `mapstructure:"security_engine_id"`
	ContextEngineId  string `mapstructure:"context_engine_id"`
	ContextName      string `mapstructure:"context_name"`
	Retries          uint   `mapstructure:"retries"`
	Timeout          int    `mapstructure:"timeout"`
}

func GetSnmpAgentConfig

func GetSnmpAgentConfig(configMap plugin.Config) (SnmpAgent, error)

GetMetricsConfig decodes and validates configuration of SNMP agent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL