Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultAuth = Auth{
Community: "public",
SecurityLevel: "noAuthNoPriv",
AuthProtocol: "MD5",
PrivProtocol: "DES",
}
DefaultWalkParams = WalkParams{
Version: 2,
MaxRepetitions: 25,
Retries: 3,
Timeout: time.Second * 20,
Auth: &DefaultAuth,
}
DefaultModule = Module{
WalkParams: DefaultWalkParams,
}
DefaultRegexpExtract = RegexpExtract{
Value: "$1",
}
)
Functions ¶
func CheckOverflow ¶
func CheckOverflow(m map[string]interface{}, ctx string) error
Types ¶
type Auth ¶
type Auth struct {
Community Secret `yaml:"community,omitempty"`
SecurityLevel string `yaml:"security_level,omitempty"`
Username string `yaml:"username,omitempty"`
Password Secret `yaml:"password,omitempty"`
AuthProtocol string `yaml:"auth_protocol,omitempty"`
PrivProtocol string `yaml:"priv_protocol,omitempty"`
PrivPassword Secret `yaml:"priv_password,omitempty"`
XXX map[string]interface{} `yaml:",inline"`
}
func (*Auth) UnmarshalYAML ¶
func (c *Auth) UnmarshalYAML(unmarshal func(interface{}) error) error
type Index ¶
type Index struct {
Labelname string `yaml:"labelname"`
Type string `yaml:"type"`
XXX map[string]interface{} `yaml:",inline"`
}
func (*Index) UnmarshalYAML ¶
func (c *Index) UnmarshalYAML(unmarshal func(interface{}) error) error
type Lookup ¶
type Lookup struct {
Labels []string `yaml:"labels"`
Labelname string `yaml:"labelname"`
Oid string `yaml:"oid"`
Type string `yaml:"type"`
XXX map[string]interface{} `yaml:",inline"`
}
func (*Lookup) UnmarshalYAML ¶
func (c *Lookup) UnmarshalYAML(unmarshal func(interface{}) error) error
type Metric ¶
type Metric struct {
Name string `yaml:"name"`
Oid string `yaml:"oid"`
Type string `yaml:"type"`
Help string `yaml:"help"`
Indexes []*Index `yaml:"indexes,omitempty"`
Lookups []*Lookup `yaml:"lookups,omitempty"`
RegexpExtracts map[string][]RegexpExtract `yaml:"regex_extracts,omitempty"`
}
func (*Metric) UnmarshalYAML ¶
func (c *Metric) UnmarshalYAML(unmarshal func(interface{}) error) error
type Module ¶
type Module struct {
// A list of OIDs.
Walk []string `yaml:"walk"`
Metrics []*Metric `yaml:"metrics"`
WalkParams WalkParams `yaml:",inline"`
XXX map[string]interface{} `yaml:",inline"`
}
func (*Module) UnmarshalYAML ¶
func (c *Module) UnmarshalYAML(unmarshal func(interface{}) error) error
type Regexp ¶ added in v0.5.0
type Regexp struct {
*regexp.Regexp
}
Regexp encapsulates a regexp.Regexp and makes it YAML marshalable.
func (Regexp) MarshalYAML ¶ added in v0.5.0
func (re Regexp) MarshalYAML() (interface{}, error)
MarshalYAML implements the yaml.Marshaler interface.
func (*Regexp) UnmarshalYAML ¶ added in v0.5.0
func (re *Regexp) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type RegexpExtract ¶ added in v0.5.0
type RegexpExtract struct {
Value string `yaml:"value"`
Regex Regexp `yaml:"regex"`
XXX map[string]interface{} `yaml:",inline"`
}
func (*RegexpExtract) UnmarshalYAML ¶ added in v0.5.0
func (c *RegexpExtract) UnmarshalYAML(unmarshal func(interface{}) error) error
type Secret ¶ added in v0.5.0
type Secret string
Secret is a string that must not be revealed on marshaling.
func (Secret) MarshalYAML ¶ added in v0.5.0
func (s Secret) MarshalYAML() (interface{}, error)
MarshalYAML implements the yaml.Marshaler interface.
func (*Secret) UnmarshalYAML ¶ added in v0.5.0
func (s *Secret) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface for Secrets.
type WalkParams ¶ added in v0.5.0
type WalkParams struct {
Version int `yaml:"version,omitempty"`
MaxRepetitions uint8 `yaml:"max_repetitions,omitempty"`
Retries int `yaml:"retries,omitempty"`
Timeout time.Duration `yaml:"timeout,omitempty"`
Auth *Auth `yaml:"auth,omitempty"`
XXX map[string]interface{} `yaml:",inline"`
}
func (WalkParams) ConfigureSNMP ¶ added in v0.5.0
func (c WalkParams) ConfigureSNMP(g *gosnmp.GoSNMP)
configureSNMP sets the various version and auth settings.
func (*WalkParams) UnmarshalYAML ¶ added in v0.5.0
func (c *WalkParams) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.