diff --git a/README.md b/README.md index ef8820e..daf535d 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,7 @@ Module: `mysql` Is looking for standard MySQL or MariaDB installations. +* Mysql version * Package versions * Service status * Configuration files from `/etc/my*` (depending on the known paths) diff --git a/modules/mysql/collector.go b/modules/mysql/collector.go index f10c29e..09bc9e1 100644 --- a/modules/mysql/collector.go +++ b/modules/mysql/collector.go @@ -22,6 +22,10 @@ var possibleConfigPaths = []string{ "/etc/mariadb*", } +var commands = map[string][]string{ + "mysql-version.txt": {"mysql", "-V"}, +} + // Detect if a MySQL or MariaDB daemon appears to be running. func Detect() string { for _, name := range possibleServices { @@ -47,4 +51,8 @@ func Collect(c *collection.Collection) { c.AddInstalledPackagesRaw(ModuleName+"/packages.txt", "*mysql*", "*mariadb*") c.AddServiceStatusRaw(ModuleName+"/service.txt", service) c.AddFilesIfFound(ModuleName, possibleConfigPaths...) + + for name, cmd := range commands { + c.AddCommandOutput(ModuleName+"/"+name, cmd[0], cmd[1:]...) + } }