livestatus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2015 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//QueryForServicesInDowntime livestatusquery for services in downtime.
	QueryForServicesInDowntime = `GET services
Columns: downtimes host_name display_name
Filter: scheduled_downtime_depth > 0
OutputFormat: csv

`
	//QueryForHostsInDowntime livestatusquery for hosts in downtime
	QueryForHostsInDowntime = `GET hosts
Columns: downtimes name
Filter: scheduled_downtime_depth > 0
OutputFormat: csv

`
	//QueryForDowntimeid livestatusquery for downtime start/end
	QueryForDowntimeid = `GET downtimes
Columns: id start_time entry_time
OutputFormat: csv

`
)
View Source
const (

	//QueryForNotifications livestatusquery for notifications.
	QueryForNotifications = `GET log
Columns: type time contact_name message
Filter: type ~ .*NOTIFICATION
Filter: time < %d
Negate:
OutputFormat: csv

`
	//QueryForComments livestatusquery for comments
	QueryForComments = `` /* 133-byte string literal not displayed */

	//QueryForDowntimes livestatusquery for downtimes
	QueryForDowntimes = `` /* 132-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache contains stored data

type CacheBuilder

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

CacheBuilder fetches data from livestatus.

func NewLivestatusCacheBuilder

func NewLivestatusCacheBuilder(livestatusConnector *Connector) *CacheBuilder

NewLivestatusCacheBuilder constructor, which also starts it immediately.

func (CacheBuilder) IsServiceInDowntime

func (builder CacheBuilder) IsServiceInDowntime(host, service, time string) bool

IsServiceInDowntime returns true if the host/service is in downtime

func (*CacheBuilder) Stop

func (builder *CacheBuilder) Stop()

Stop signals the cache to stop.

type Collector

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

Collector fetches data from livestatus.

func NewLivestatusCollector

func NewLivestatusCollector(jobs chan interface{}, livestatusConnector *Connector, fieldSeperator string) *Collector

NewLivestatusCollector constructor, which also starts it immediately.

func (*Collector) Stop

func (live *Collector) Stop()

Stop signals the collector to stop.

type CommentData

type CommentData struct {
	Data
	// contains filtered or unexported fields
}

CommentData adds Comments types to the livestatus data

func (CommentData) Print

func (comment CommentData) Print(version float32) string

Print srints the data in influxdb lineformat

type Connector

type Connector struct {
	Log               *factorlog.FactorLog
	LivestatusAddress string
	ConnectionType    string
}

Connector fetches data from livestatus.

type Data

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

Data contains basic data extracted from livestatusqueries.

type DowntimeData

type DowntimeData struct {
	Data
	// contains filtered or unexported fields
}

DowntimeData adds Comments types to the livestatus data

func (DowntimeData) Print

func (downtime DowntimeData) Print(version float32) string

Print prints the data in influxdb lineformat

type NotificationData

type NotificationData struct {
	Data
	// contains filtered or unexported fields
}

NotificationData adds notification types to the livestatus data

func (NotificationData) Print

func (notification NotificationData) Print(version float32) string

Print prints the data in influxdb lineformat

type Printable

type Printable interface {
	Print(version float32) string
}

Printable this interface should be used to push data into the queue.

Jump to

Keyboard shortcuts

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