config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseHIL

func ParseHIL(input string, hilConfig *hil.EvalConfig) (hil.EvaluationResult, error)

Types

type Check

type Check struct {
	Plugin         string               `hcl:"plugin"`
	PluginInstance string               `hcl:"plugin_instance"`
	Type           string               `hcl:"type"`
	TypeInstance   string               `hcl:"type_instance"`
	Comparator     Comparator           `hcl:"comparator"`
	WarningTpl     string               `hcl:"warning"`
	CriticalTpl    string               `hcl:"critical"`
	Warning        hil.EvaluationResult `hcl:"-"`
	Critical       hil.EvaluationResult `hcl:"-"`
	ValueTpl       string               `hcl:"value"`
	Value          *template.Template   `hcl:"-"`
	HostThresholds CheckThresholdMap    `hcl:"host"`
	MetaThresholds CheckThresholdMap    `hcl:"meta"`
	Humanize       string               `hcl:"humanize"`
}

func (*Check) FormatOutput added in v0.1.2

func (c *Check) FormatOutput(value string) string

type CheckThreshold added in v0.0.2

type CheckThreshold struct {
	WarningTpl  string               `hcl:"warning"`
	CriticalTpl string               `hcl:"critical"`
	Priority    int                  `hcl:"priority"`
	Warning     hil.EvaluationResult `hcl:"-"`
	Critical    hil.EvaluationResult `hcl:"-"`
	Regexp      *regexp.Regexp       `hcl:"-"`
}

type CheckThresholdMap added in v0.1.0

type CheckThresholdMap map[string]CheckThreshold

func (CheckThresholdMap) CompileRegexp added in v0.1.1

func (m CheckThresholdMap) CompileRegexp() error

func (CheckThresholdMap) Parse added in v0.1.0

func (m CheckThresholdMap) Parse(hilConfig *hil.EvalConfig) (err error)

type Comparator

type Comparator string
const (
	GreaterThan          Comparator = ">"
	GreaterThanOrEqualTo Comparator = ">="
	LesserThanOrEqualTo  Comparator = "<="
	LesserThan           Comparator = "<"
)

type Config

type Config struct {
	CheckResultsDir string           `hcl:"check_results_dir"`
	Checks          map[string]Check `hcl:"check"`
}

func Read

func Read(configFile string) (*Config, error)

Jump to

Keyboard shortcuts

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