config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAlertLevel added in v0.2.0

func ConvertAlertLevel(s string) mackerel.CheckStatus

無指定の場合は WARNING 入力は ValidateAlertLevel で検査されていること

func ValidateAlertLevel added in v0.2.0

func ValidateAlertLevel(s string) error

Types

type Config

type Config struct {
	MIB        *MIB        `yaml:"mib"`
	TrapServer *TrapServer `yaml:"snmp"`
	Trap       []*Trap     `yaml:"trap"`
	LogLebel   string      `yaml:"log-level"`
	DryRun     bool        `yaml:"dry-run"`
	Mackerel   *Mackerel   `yaml:"mackerel"`
	Encoding   []*Encoding `yaml:"encoding"`
}

func (*Config) GetLogLebel added in v0.2.2

func (c *Config) GetLogLebel() (level slog.Level, ok bool)

func (*Config) RunningMode

func (c *Config) RunningMode() string

func (*Config) SortedTrapRules added in v0.2.1

func (c *Config) SortedTrapRules() ([]*Trap, error)

type Encoding

type Encoding struct {
	Address string          `yaml:"addr"`
	Charset charset.Charset `yaml:"charset"`
}

type MIB

type MIB struct {
	Directory   []string `yaml:"directory"`
	LoadModules []string `yaml:"modules"`
}

type Mackerel

type Mackerel struct {
	ApiKey  string `yaml:"x-api-key"`
	ApiBase string `yaml:"apibase"`
	HostID  string `yaml:"host-id"`
}

type Trap

type Trap struct {
	Ident       string `yaml:"ident"`
	ParsedIdent []int  `yaml:"-"`
	Format      string `yaml:"format"`
	AlertLevel  string `yaml:"alert-level"` // warning, critical, unknown. default: warning
}

type TrapServer

type TrapServer struct {
	Address   string `yaml:"addr"`
	Port      string `yaml:"port"`
	Community string `yaml:"community"`
}

Jump to

Keyboard shortcuts

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