shcollectors

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package shcollectors (gocollect) makes shell-script plugins available for collection.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(paths []string) *data.Collectors

Find returns a object that holds all runnable collector scripts found in the supplied paths.

The paths are scanned in reverse order. The file name is the unique key name. If the file is not executable, the collector is disabled.

Example
collectors := Find([]string{"../collectors"})

// collectors.GetRunnable() has all keys of runnable collectors.
runnableCount := len(collectors.GetRunnable())
if runnableCount < 5 {
	fmt.Println("strange, very few runners?")
}

// We can run a single collector using those keys. For instance the
// core.id key.
data := collectors.Run("core.id")
ip4 := data.GetString("ip4")
if ip4 == "" {
	fmt.Println("ip4 empty?")
}

fmt.Println("runnables found")
Output:

runnables found

Types

This section is empty.

Jump to

Keyboard shortcuts

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