juggler

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: LGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalCache *cache.TTLCache

GlobalCache for juggler checks

Functions

func GetConfigDir added in v1.0.0

func GetConfigDir() string

GetConfigDir where senders config placed

func InitEventsStore added in v1.0.0

func InitEventsStore(config *pluginEventsStoreConfig)

InitEventsStore initiate global plugin events store for save juggler events history and use it as antiflap method

func InitializeCache added in v1.8.1

func InitializeCache()

InitializeCache ...

func LoadPlugin

func LoadPlugin(id, dir, name string) (*lua.LState, error)

LoadPlugin cleanup lua state global/local environment and load lua plugin by name from juggler config section

func PreloadTools

func PreloadTools(id string, l *lua.LState) error

PreloadTools preload go functions in lua global environment

func UpdateTaskConfig added in v0.12.1

func UpdateTaskConfig(taskConf *Config, conf *SenderConfig) error

UpdateTaskConfig update current task config, set default settings if it need

Types

type Config

type Config struct {
	PluginsDir       string                       `codec:"plugins_dir"`
	Plugin           string                       `codec:"plugin"`
	Host             string                       `codec:"Host"`
	Method           string                       `codec:"Method"`
	Aggregator       string                       `codec:"Aggregator"`
	AggregatorKWArgs repository.PluginConfig      `codec:"aggregator_kwargs"`
	Notifications    []repository.PluginConfig    `codec:"notifications"`
	TTL              int                          `codec:"ttl"`
	CheckName        string                       `codec:"checkname"`
	Description      string                       `codec:"description"`
	Tags             []string                     `codec:"tags"`
	Flaps            *jugglerFlapConfig           `codec:"flaps"`
	Variables        map[string]string            `codec:"variables"`
	FlapsByChecks    map[string]jugglerFlapConfig `codec:"flaps_by_checks"`
	JPluginConfig    repository.PluginConfig      `codec:"config"`
	JHosts           []string                     `codec:"juggler_hosts"`
	JFrontend        []string                     `codec:"juggler_frontend"`
	OK               []string                     `codec:"OK"`
	INFO             []string                     `codec:"INFO"`
	WARN             []string                     `codec:"WARN"`
	CRIT             []string                     `codec:"CRIT"`
	BatchSize        int                          `codec:"batch_size"`
	BatchEndpoint    string                       `codec:"batch_endpoint"`
	Namespace        string                       `codec:"namespace"`
	Token            string                       `codec:"-"` // do not pass token
}

Config contains config section from combainer's aggregations section also it include default sender config (or user specified) yaml config

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig build default config for sender, it has sanity defaults

type Sender

type Sender struct {
	*Config
	// contains filtered or unexported fields
}

Sender main object

func NewSender added in v0.9.1

func NewSender(conf *Config, id string) (*Sender, error)

NewSender return sender object with specified config

func (*Sender) Send

func (js *Sender) Send(ctx context.Context, task *senders.SenderTask) error

Send make all things abount juggler sender tasks

type SenderConfig

type SenderConfig struct {
	CacheTTL           time.Duration           `yaml:"cache_ttl"`
	CacheCleanInterval time.Duration           `yaml:"cache_clean_interval"`
	PluginsDir         string                  `yaml:"plugins_dir"`
	Hosts              []string                `yaml:"juggler_hosts"`
	Frontend           []string                `yaml:"juggler_frontend"`
	BatchSize          int                     `yaml:"batch_size"`
	BatchEndpoint      string                  `yaml:"batch_endpoint"`
	Token              string                  `yaml:"token"`
	Store              pluginEventsStoreConfig `yaml:"store"`
}

SenderConfig contains configuration loaded from combaine's config file placed in sender config

func GetSenderConfig added in v0.9.1

func GetSenderConfig() (*SenderConfig, error)

GetSenderConfig read global sender config usual from /etc/combaine/juggler.yaml

Jump to

Keyboard shortcuts

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