nagios

package
v0.0.0-...-3645f34 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinKeyValues

func JoinKeyValues(m map[string]string, sep string) []string

JoinKeyValues create a slice of the provided map, joining the keys with their values using the defined separator

func MapVarsProvider

func MapVarsProvider(m map[string][]string) func(string) []string

MapVarsProvider is a wrapper around the map lookup operator, but instead of returning 2 variables, the result is simply nil if the lookup fails

Types

type PluginBuilder

type PluginBuilder struct {
	// contains filtered or unexported fields
}

func NewPluginBuilder

func NewPluginBuilder(cache *template.TemplateCache) *PluginBuilder

func (*PluginBuilder) Build

type PluginBuilderContext

type PluginBuilderContext struct {
	Vars map[string][]string
	Env  map[string]string
}

PluginBuilderContext is a template execution context

func NewLazyPluginBuilderContext

func NewLazyPluginBuilderContext(vars map[string]config.LazyArray, env map[string]string) *PluginBuilderContext

NewLazyPluginBuilderContext creates a new plugin builder context. the variables are copied as is to match the type signature of the internal struct member.

func NewPluginBuilderContext

func NewPluginBuilderContext(vars map[string][]string, env map[string]string) *PluginBuilderContext

NewPluginBuilderContext creates a new plugin builder context

func (*PluginBuilderContext) VisitEnvironment

func (c *PluginBuilderContext) VisitEnvironment(provider func(string) string) *PluginBuilderContext

VisitEnvironment populates the instance Vars with values from the provider. If the provider does not yield a value for the map keys, the original value is used as fallback. If the result of that operation yields an empty value (i.e. an empty string), the key will be remove from the instance map.

func (*PluginBuilderContext) VisitVariables

func (c *PluginBuilderContext) VisitVariables(provider func(string) []string) *PluginBuilderContext

VisitVariables populates the instance Vars with values from the provider. If the provider does not yield a value for the map keys, the original value is used as fallback. If the result of that operation yields an empty value (i.e. nil or an empty slice), the key will be remove from the instance map.

Empty values are removed from the map values as well

type PluginMetrics

type PluginMetrics struct {
	// contains filtered or unexported fields
}

func NewPluginMetrics

func NewPluginMetrics(module *config.Module, namespace string) *PluginMetrics

func (*PluginMetrics) Register

func (m *PluginMetrics) Register(registry *prometheus.Registry) error

func (*PluginMetrics) Report

func (m *PluginMetrics) Report(output *monitoring.PluginResult, err error, duration float64)

Jump to

Keyboard shortcuts

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