Code Monkey home page Code Monkey logo

Comments (9)

cavaliercoder avatar cavaliercoder commented on June 12, 2024

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:

  • selinux
  • iptables/firewalld

from libzbxpgsql.

haiscd avatar haiscd commented on June 12, 2024

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@_~]# zabbix_get -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@******** ~]# zabbix_get -s 127.0.0.1 -k "pg.connect[host=127.0.0.1 user=monitoring port=5411 password=_,postgres]"
[root@_
~]#

from libzbxpgsql.

cavaliercoder avatar cavaliercoder commented on June 12, 2024

Did anything show up in the Zabbix agent logs for the failed zabbix_get?

from libzbxpgsql.

haiscd avatar haiscd commented on June 12, 2024

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.

from libzbxpgsql.

cavaliercoder avatar cavaliercoder commented on June 12, 2024

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?

from libzbxpgsql.

ruiztulio avatar ruiztulio commented on June 12, 2024

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:
a

Nothing is shown in the agent log, then I tested with wrong credentials (just to double check):
b

And the message is propely logged in the agent log file:

c

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.

from libzbxpgsql.

cavaliercoder avatar cavaliercoder commented on June 12, 2024

@ruiztulio please see #57. If switching to standard checks does not solve your issue, please raise a separate issue.

from libzbxpgsql.

cavaliercoder avatar cavaliercoder commented on June 12, 2024

@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.

from libzbxpgsql.

piseydba avatar piseydba commented on June 12, 2024

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.

from libzbxpgsql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.