Minor usability fixes to config

This commit is contained in:
Evan Phoenix
2015-05-18 15:22:04 -07:00
parent 82cbc4daa2
commit 13e6018eb0
4 changed files with 103 additions and 38 deletions

View File

@@ -31,7 +31,7 @@ var sampleConfig = `
# to sslmode=disable as well.
#
address = "localhost"
address = "sslmode=disable"
# A list of databases to pull metrics about. If not specified, metrics for all
# databases are gathered.
@@ -69,6 +69,10 @@ func (p *Postgresql) Gather(acc plugins.Accumulator) error {
}
func (p *Postgresql) gatherServer(serv *Server, acc plugins.Accumulator) error {
if serv.Address == "" {
serv = localhost
}
db, err := sql.Open("postgres", serv.Address)
if err != nil {
return err