Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ See [modules/mysql/collector.go](modules/mysql/collector.go) for details.

Module: `postgresql`

* PostgreSQL version
* Package versions
* Service status
* Configuration files from `/etc/postgresql` and `/var/lib/pgsql` (depending on OS)
Expand Down
8 changes: 8 additions & 0 deletions modules/postgresql/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ var files = []string{
"/var/lib/pgsql/data/*.conf", // RedHat based systems, where the configuration is found
}

var commands = map[string][]string{
"version.txt": {"psql", "-V"},
}

var possibleServices = []string{
"postgresql",
}
Expand Down Expand Up @@ -46,4 +50,8 @@ func Collect(c *collection.Collection) {
for _, service := range possibleServices {
c.AddServiceStatusRaw(ModuleName+"/service-"+service+".txt", service)
}

for name, cmd := range commands {
c.AddCommandOutput(ModuleName+"/"+name, cmd[0], cmd[1:]...)
}
}