Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Argument ¶
type Argument struct { Condition BoolString `yaml:"set_if,omitempty"` Value LazyArray `yaml:"value,omitempty"` Order int `yaml:"order,omitempty"` Key string `yaml:"key,omitempty"` Required BoolString `yaml:"required,omitempty"` RepeatKey BoolString `yaml:"repeat_key,omitempty"` SkipKey BoolString `yaml:"skip_key,omitempty"` Separator string `yaml:"separator,omitempty"` }
Argument defines the condition and representation of a commandline argument to a module command
func (*Argument) MarshalIcinga ¶
MarshalIcinga renders the argument in the Icinga config syntax format
func (*Argument) UnmarshalYAML ¶
UnmarshalYAML populates the instace fields from the given data node
type BoolString ¶
type BoolString string
BooleanString is a string type, which can be unmarshaled from a native bool value
func (*BoolString) UnmarshalYAML ¶
func (b *BoolString) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML populates the instace from the given data node
type Config ¶
Config defines the configuration root node
func (*Config) MarshalYAML ¶
YAML renders the instance as YAML representation
type LazyArray ¶
type LazyArray []string
LazyArray is an array instance, which can be declared using a single-item notation
func (LazyArray) MarshalIcinga ¶
MarshalIcinga renders the array in the Icinga config syntax format
func (*LazyArray) UnmarshalYAML ¶
UnmarshalYAML populates the instace from the given data node
type Module ¶
type Module struct { Command string `yaml:"command,omitempty"` Timeout NumberDuration `yaml:"timeout,omitempty"` Arguments map[string]Argument `yaml:"arguments,omitempty"` Variables map[string]LazyArray `yaml:"variables,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` }
Module defines a reusable monitoring execution plan
func FromContext ¶
FromContext returns the Module (+ name) value stored in ctx, if any.
type NumberDuration ¶
NumberDuration is a time.Duration implementation which can optionally be declared without any time scale (defaulting to seconds)
func (NumberDuration) String ¶
func (n NumberDuration) String() string
String renders the duration instance in seconds
func (*NumberDuration) UnmarshalYAML ¶
func (n *NumberDuration) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML populates the instace from the given data node
type SafeConfig ¶
SafeConfig is thread-safe Config instance provider
func NewSafeConfig ¶
func NewSafeConfig(namespace string, reg prometheus.Registerer) *SafeConfig
NewSafeConfig creates a new SafeConfig instance
func (*SafeConfig) ProvideConfig ¶
func (sc *SafeConfig) ProvideConfig(visitor func(*Config))
ProvideConfig is a thread-safe visitor implementation, to gain access to the internal config instance.
func (*SafeConfig) ReloadConfig ¶
func (sc *SafeConfig) ReloadConfig(confFile string, logger log.Logger) (err error)
ReloadConfig reads the configuration from the given path and updates its internal config instance with the parsed result
func (*SafeConfig) UpdateConfig ¶
func (sc *SafeConfig) UpdateConfig(c *Config)
UpdateConfig replaces the internal config instance with the given one (thread-safe)