Documentation ¶
Index ¶
- Constants
- func FilesInDirectoryOlderThanX(folder string, age time.Duration) []string
- func IsItTime(timeStamp time.Time, duration time.Duration) bool
- func NagiosSpoolfileWorkerGenerator(jobs chan string, results collector.ResultQueues, ...) func() *NagiosSpoolfileWorker
- type NagiosSpoolfileCollector
- type NagiosSpoolfileWorker
- type PerformanceData
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func FilesInDirectoryOlderThanX ¶
FilesInDirectoryOlderThanX returns a list of file, of a folder, names which are older then a certain duration.
func NagiosSpoolfileWorkerGenerator ¶
func NagiosSpoolfileWorkerGenerator(jobs chan string, results collector.ResultQueues, livestatusCacheBuilder *livestatus.CacheBuilder, fileBufferSize int, defaultTarget collector.Filterable) func() *NagiosSpoolfileWorker
NagiosSpoolfileWorkerGenerator generates a worker and starts it.
Types ¶
type NagiosSpoolfileCollector ¶
type NagiosSpoolfileCollector struct {
// contains filtered or unexported fields
}
NagiosSpoolfileCollector scans the nagios spoolfile folder and delegates the files to its workers.
func NagiosSpoolfileCollectorFactory ¶
func NagiosSpoolfileCollectorFactory(spoolDirectory string, workerAmount int, results collector.ResultQueues, livestatusCacheBuilder *livestatus.CacheBuilder, fileBufferSize int, defaultTarget collector.Filterable) *NagiosSpoolfileCollector
NagiosSpoolfileCollectorFactory creates the give amount of Woker and starts them.
func (*NagiosSpoolfileCollector) Stop ¶
func (s *NagiosSpoolfileCollector) Stop()
Stop stops his workers and itself.
type NagiosSpoolfileWorker ¶
type NagiosSpoolfileWorker struct {
// contains filtered or unexported fields
}
NagiosSpoolfileWorker parses the given spoolfiles and adds the extraced perfdata to the queue.
func NewNagiosSpoolfileWorker ¶
func NewNagiosSpoolfileWorker(workerID int, jobs chan string, results collector.ResultQueues, livestatusCacheBuilder *livestatus.CacheBuilder, fileBufferSize int, defaultTarget collector.Filterable) *NagiosSpoolfileWorker
NewNagiosSpoolfileWorker returns a new NagiosSpoolfileWorker.
func (*NagiosSpoolfileWorker) PerformanceDataIterator ¶
func (w *NagiosSpoolfileWorker) PerformanceDataIterator(input map[string]string) <-chan PerformanceData
PerformanceDataIterator returns an iterator to loop over generated perf data.
type PerformanceData ¶
type PerformanceData struct { collector.Filterable Hostname string Service string Command string PerformanceLabel string Unit string Time string Tags map[string]string Fields map[string]string }
PerformanceData represents the nagios perfdata
func (PerformanceData) PrintForElasticsearch ¶
func (p PerformanceData) PrintForElasticsearch(version, index string) string
PrintForElasticsearch prints in the elasticsearch json format
func (PerformanceData) PrintForInfluxDB ¶
func (p PerformanceData) PrintForInfluxDB(version string) string
PrintForInfluxDB prints the data in influxdb lineformat