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.
Click to show internal directories.
Click to hide internal directories.