Documentation ¶
Index ¶
Constants ¶
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 ` )
const ( QueryLivestatusVersion = `GET status Columns: livestatus_version OutputFormat: csv ` //QueryIcinga2ForNotifications livestatusquery for notifications with Icinga2 Livestatus. QueryIcinga2ForNotifications = `GET log Columns: type time contact_name message Filter: type ~ .*NOTIFICATION Filter: time < %d Negate: OutputFormat: csv ` //QueryNagiosForNotifications livestatusquery for notifications with nagioslike Livestatus. QueryNagiosForNotifications = `GET log Columns: type time contact_name message Filter: type ~ .*NOTIFICATION Filter: time > %d OutputFormat: csv ` //QueryForComments livestatusquery for comments QueryForComments = `` /* 133-byte string literal not displayed */ //QueryForDowntimes livestatusquery for downtimes QueryForDowntimes = `` /* 132-byte string literal not displayed */ //Nagios nagioslike Livestatus Nagios = iota //Icinga2 icinga2like Livestatus Icinga2 = iota //Naemon naemonlike Livestatus Naemon = iota )
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
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector fetches data from livestatus.
func NewLivestatusCollector ¶
func NewLivestatusCollector(jobs collector.ResultQueues, livestatusConnector *Connector, detectVersion string) *Collector
NewLivestatusCollector constructor, which also starts it immediately.
type CommentData ¶
type CommentData struct { collector.Filterable Data // contains filtered or unexported fields }
CommentData adds Comments types to the livestatus data
func (CommentData) PrintForElasticsearch ¶ added in v0.2.0
func (comment CommentData) PrintForElasticsearch(version, index string) string
PrintForElasticsearch prints in the elasticsearch json format
func (CommentData) PrintForInfluxDB ¶ added in v0.2.0
func (comment CommentData) PrintForInfluxDB(version string) string
PrintForInfluxDB prints the data in influxdb lineformat
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
Data contains basic data extracted from livestatusqueries.
type DowntimeData ¶
type DowntimeData struct { collector.Filterable Data // contains filtered or unexported fields }
DowntimeData adds Comments types to the livestatus data
func (DowntimeData) PrintForElasticsearch ¶ added in v0.2.0
func (downtime DowntimeData) PrintForElasticsearch(version, index string) string
PrintForElasticsearch prints in the elasticsearch json format
func (DowntimeData) PrintForInfluxDB ¶ added in v0.2.0
func (downtime DowntimeData) PrintForInfluxDB(version string) string
PrintForInfluxDB prints the data in influxdb lineformat
type NotificationData ¶
type NotificationData struct { collector.Filterable Data // contains filtered or unexported fields }
NotificationData adds notification types to the livestatus data
func (NotificationData) PrintForElasticsearch ¶ added in v0.2.0
func (notification NotificationData) PrintForElasticsearch(version, index string) string
PrintForElasticsearch prints in the elasticsearch json format
func (NotificationData) PrintForInfluxDB ¶ added in v0.2.0
func (notification NotificationData) PrintForInfluxDB(version string) string
PrintForInfluxDB prints the data in influxdb lineformat