lesovsky / zabbix-extensions

Zabbix additional monitoring modules
BSD 3-Clause "New" or "Revised" License
315 stars 230 forks source link

A problem about your postgresql config file #22

Closed shunza closed 6 years ago

shunza commented 8 years ago

Hi, Just now, I used yours postgresql template, I found pg.ping has no data. I found an error in your config files. In your file , you written "UserParameter=pgsql.ping[*],/bin/echo -e "\timing \n select 1" | psql -qAtX $1 |grep Time |cut -d' ' -f2" . Run User Parameter ,you will found you can't get a time, because "psql -qAtX" and "psql" has different . so you should delete "-qAtX" from here ensure to get a run-time value.

if you has any other problem, email to me. Email: yashun.ren@gmail.com

thanks.

stephankn commented 6 years ago

Works fine for me with a recent version of PostgreSQL

please specify what exactly fails for you. Also which of the four parameters are considered problematic by you.

Otherwise I suggest to close this issue.

$ /bin/echo -e "\\\timing \n select 1" | psql -qAtX -h 127.0.0.1 -p 5432 -U postgres -d db | tail -n 1 | cut -d' ' -f2                               
0.319                                                                                                                                                                                                    
$ psql --version                                                                                                                                      
psql (PostgreSQL) 10.1                                                                                                                                                                                   
stephankn commented 6 years ago

please re-open in case problem still exists for you and provide more details