-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Launcher Info Table: kolide_launcher_info (#121)
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package osquery | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/kolide/kit/version" | ||
"github.com/kolide/osquery-go" | ||
"github.com/kolide/osquery-go/plugin/table" | ||
) | ||
|
||
func LauncherInfo(client *osquery.ExtensionManagerClient) *table.Plugin { | ||
columns := []table.ColumnDefinition{ | ||
table.TextColumn("version"), | ||
table.TextColumn("go_version"), | ||
table.TextColumn("branch"), | ||
table.TextColumn("revision"), | ||
table.TextColumn("build_date"), | ||
table.TextColumn("build_user"), | ||
} | ||
return table.NewPlugin("kolide_launcher_info", columns, generateLauncherInfo(client)) | ||
} | ||
|
||
func generateLauncherInfo(client *osquery.ExtensionManagerClient) table.GenerateFunc { | ||
return func(ctx context.Context, queryContext table.QueryContext) ([]map[string]string, error) { | ||
results := []map[string]string{ | ||
map[string]string{ | ||
"version": version.Version().Version, | ||
"go_version": version.Version().GoVersion, | ||
"branch": version.Version().Branch, | ||
"revision": version.Version().Revision, | ||
"build_date": version.Version().BuildDate, | ||
"build_user": version.Version().BuildUser, | ||
}, | ||
} | ||
|
||
return results, nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters