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 map[data.Datatype]chan collector.Printable, ...) 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 map[data.Datatype]chan collector.Printable, livestatusCacheBuilder *livestatus.CacheBuilder, fileBufferSize int) 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 map[data.Datatype]chan collector.Printable, livestatusCacheBuilder *livestatus.CacheBuilder, fileBufferSize int) *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 ¶ added in v0.2.1
func NewNagiosSpoolfileWorker(workerID int, jobs chan string, results map[data.Datatype]chan collector.Printable, livestatusCacheBuilder *livestatus.CacheBuilder, fileBufferSize int) *NagiosSpoolfileWorker
NewNagiosSpoolfileWorker returns a new NagiosSpoolfileWorker.
func (*NagiosSpoolfileWorker) PerformanceDataIterator ¶ added in v0.2.1
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 {
// contains filtered or unexported fields
}
PerformanceData represents the nagios perfdata
func (PerformanceData) PrintForElasticsearch ¶ added in v0.2.0
func (p PerformanceData) PrintForElasticsearch(version, index string) string
PrintForElasticsearch prints in the elasticsearch json format
func (PerformanceData) PrintForInfluxDB ¶ added in v0.2.0
func (p PerformanceData) PrintForInfluxDB(version string) string
PrintForInfluxDB prints the data in influxdb lineformat