Closed haiscd closed 7 years ago
Thanks for raising this with the thorough info.
I can't see any issue with your configuration so we might need to just confirm a few components.
Can you please confirm if there are any PostgreSQL connection errors in your Zabbix agent log? I don't see any there which indicates that the agent is actually not even trying to connect. Perhaps the agent configuration is not propagating from the Zabbix server to the agent for active items?
Can you please try connecting from the local host using psql
, ensuring you are connecting via TCP/IP rather than Unix sockets. Please use the same connection settings (user, password, etc.) as your Zabbix connection string and then post the command and output here (omitting sensitive details).
If that works, please try querying the Zabbix agent with zabbix_get -s 127.0.0.1 -k "pg.connect[<conn string>]"
and do the same.
These will confirm that PostgreSQL is correctly configured and that it is reachable using your connection string.
Some things that could be in the way:
Thanks Ryan for responding to my query.
I was able to connect to make local connection. However zabbix_get is not giving any output.
[root@****_~]# zabbixget -s 127.0.0.1 -k "pg.connect[host=127.0.0.1 user=monitoring port=5411 password=******,postgres]" [root@sj1glm1014 ~]# psql -h127.0.0.1 -p5411 -Umonitoring postgres Password for user monitoring: psql (8.4.20, server 9.5.1) WARNING: psql version 8.4, server version 9.5. Some psql features might not work. Type "help" for help.
postgres=> postgres=> postgres=> \q [root@*** ~]# zabbixget -s 127.0.0.1 -k "pg.connect[host=127.0.0.1 user=monitoring port=5411 password=****,postgres]" [root@**_*****~]#
Did anything show up in the Zabbix agent logs for the failed zabbix_get?
Strangely nothing is getting appended to zabbix log. It has the same entries that are shared earlier.
23405:20160518:121117.214 Starting Zabbix Agent [Zabbix server]. Zabbix 2.4.7 (revision 56694). 23405:20160518:121117.214 using configuration file: /etc/zabbix/zabbix_agentd.conf 23405:20160518:121117.215 Starting agent module libzbxpgsql 0.2.1 23405:20160518:121117.215 loaded modules: libzbxpgsql.so 23405:20160518:121117.216 agent #0 started [main process] 23407:20160518:121117.216 agent #1 started [collector] 23408:20160518:121117.216 agent #2 started [listener #1] 23409:20160518:121117.217 agent #3 started [listener #2] 23410:20160518:121117.217 agent #4 started [listener #3] 23411:20160518:121117.217 agent #5 started [active checks #1] 23411:20160518:121117.217 active check configuration update from [127.0.0.1:10051] started to fail (cannot connect to [[127.0.0.1]:10051]: [111] Connection refused)
We don't set firewall rules for any local connections. Does zabbix server needs direct access to postgresql instance? Our assumption is zabbix agent has to collect all the relevant information and push to zabbix server through 10051 port. Correct me if I am wrong.
That's really odd. It feels like the Zabbix agent is not even attempting to connect to PG. If there was a connection error, it would definitely be in the logs.
Can you please try another zabbix_get
with debug logging enabled in the agent?
Hi,
I have a similar issue, but I don't know if it is related, I used zabbix_get to test the connection and it seems to be ok:
Nothing is shown in the agent log, then I tested with wrong credentials (just to double check):
And the message is propely logged in the agent log file:
Then my issue is that nothing is shown in the Zabbix web interface: ![http://screenshots.vauxoo.com/tulio/16563521416-BFb8OyJOos.jpg]
But also no error is shown in the log (nor server neither agent). Just in case I "copy and pate" the credentials from the macro to the console to be sure I'm using the same.
Running Zabbix 3.0.4 in Ubuntu 16.04 (both machines) and Postgresql 9.5
If there's any other information I can provide you with let me know.
Regards.
@ruiztulio please see #57. If switching to standard checks does not solve your issue, please raise a separate issue.
@haiscd have you solved this issue? Have your tried Zabbix v3 with libzbxpgsql v1.0.0?
If this is still a problem, please post the previously requested log file.
I met the same error: but after i use "Template_PostgreSQL_Server_3.0.xml" template and Zabbix v3 with libzbxpgsql v1.0.0. the problem was solve.
We are having an issue with zabbix monitoring for PostgreSQL instances runnning on non-default ports and could not identify the issue.
Zabbix Version - 2.4.7 PostgreSQL DB version - 9.5.1
Zabbix monitoring is setup as per the documentation. PostgreSQL server has to run with non-default port (5411) due to security issues.
I can see libzbxpgsql module is loaded from zabbix agent log on DB server.
Monitoring template is imported and macros are edited to use the non-default port.
I have added below entries in both pg_hba.conf and pg_identi.conf
pg_hba.conf
pg_ident.conf
libzbxpgsql checks are pointing only to default port 5432.
zabbix_agentd -p | grep '^pg.'
And Zabbix monitoring data is completely empty
is there anything incorrect in our configuration?