sensu

package
v0.0.0-...-945b3b5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeSuccess = iota
	ExitCodeWarning
	ExitCodeFailure
)

Standard Sensu return codes

Variables

This section is empty.

Functions

This section is empty.

Types

type Check

type Check struct {
	Command      string   `json:"command"`
	Subscribers  []string `json:"subscribers"`
	Interval     int      `json:"interval"`
	Timeout      int      `json:"timeout"`
	TTL          int      `json:"ttl"`
	TTLStatus    int      `json:"ttl_status"`
	Occurrences  int      `json:"occurrences"`
	Refresh      int      `json:"refresh"`
	Handlers     []string `json:"handlers"`
	Dependencies []string `json:"dependencies"`
}

Check holds data for single Sensu check to be scheduled

type Executor

type Executor struct {
	ClientName string
	TmpBaseDir string
	ShellPath  string
	// contains filtered or unexported fields
}

Executor executes checks based on incoming requests

func NewExecutor

func NewExecutor(cfg *config.INIConfig, logger *logging.Logger) (*Executor, error)

NewExecutor creates and initialize executor struct

func (*Executor) Clean

func (self *Executor) Clean()

func (*Executor) Execute

func (self *Executor) Execute(request connector.CheckRequest) (connector.CheckResult, error)

Execute prepares script for single check based on given the request and then executes it

type Scheduler

type Scheduler struct {
	Checks map[string]Check
	// contains filtered or unexported fields
}

Scheduler holds data for scheduling standaline checks

func NewScheduler

func NewScheduler(cfg *config.INIConfig, logger *logging.Logger) (*Scheduler, error)

NewScheduler creates Sensu standalone check scheduler according to configuration

func (*Scheduler) Start

func (sched *Scheduler) Start(outchan chan interface{})

Start schedules tickers to each check which will send the results to outchan.

Jump to

Keyboard shortcuts

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