Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fe_sendauth: no password supplied #30

Closed
Wicaeed opened this issue Jan 8, 2016 · 4 comments
Closed

fe_sendauth: no password supplied #30

Wicaeed opened this issue Jan 8, 2016 · 4 comments

Comments

@Wicaeed
Copy link

Wicaeed commented Jan 8, 2016

This isn't a duplicate of #19 I swear!

I have a new Zabbix server installation running an Ubuntu 14.04 Zabbix 2.4.7 installation with a PostgreSQL 9.4 as the DB on another server. The Agent is set up and running on the DB server, and successfully collecting data, as well as talking back to the Zabbix server.

Like Issue #19, I've followed the installation instructions to get libzbxpgsql installed, and it is actually loading as per the Zabbix agent logs:

70358:20160108:105140.485 Got signal [signal:15(SIGTERM),sender_pid:1,sender_uid:0,reason:0]. Exiting ...
 70357:20160108:105140.485 Got signal [signal:15(SIGTERM),sender_pid:1,sender_uid:0,reason:0]. Exiting ...
 70356:20160108:105140.486 Got signal [signal:15(SIGTERM),sender_pid:1,sender_uid:0,reason:0]. Exiting ...
 70355:20160108:105140.486 Got signal [signal:15(SIGTERM),sender_pid:1,sender_uid:0,reason:0]. Exiting ...
 70354:20160108:105140.487 Got signal [signal:15(SIGTERM),sender_pid:1,sender_uid:0,reason:0]. Exiting ...
 70352:20160108:105140.488 One child process died (PID:70358,exitcode/signal:255). Exiting ...
zabbix_agentd [70352]: Error on thread waiting.
 70352:20160108:105140.488 Zabbix Agent stopped. Zabbix 2.2.2 (revision 42525).
122901:20160108:105140.502 Starting Zabbix Agent [zabbix-db.lan.local]. Zabbix 2.2.2 (revision 42525).
122901:20160108:105140.502 using configuration file: /etc/zabbix/zabbix_agentd.conf
122901:20160108:105140.504 Starting agent module libzbxpgsql 0.2.1
122901:20160108:105140.504 loaded modules: libzbxpgsql.so
122906:20160108:105140.506 agent #3 started [listener #3]
122903:20160108:105140.506 agent #0 started [collector]
122907:20160108:105140.506 agent #4 started [active checks #1]
122904:20160108:105140.507 agent #1 started [listener #1]
122905:20160108:105140.507 agent #2 started [listener #2]
122907:20160108:105140.523 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

Checking the Zabbix Agent for PostgreSQL info I see:

$ sudo su -c "zabbix_agentd -p" -s /bin/bash zabbix | grep '^pg'
zabbix_agentd [3357]: Starting agent module libzbxpgsql 0.2.1
pg.modver                                     [s|libzbxpgsql 0.2.1]
pg.connect                                    [u|1]
pg.version                                    [s|PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit]
pg.starttime                                  [s|2016-01-06 15:36:03.557795-08]
pg.uptime                                     [u|166286]
pg.setting[,,data_directory]                  [m|ZBX_NOTSUPPORTED]
pg.setting.discovery                          [s|{
pg.query.string[,,SELECT 'Lorem ipsum dolor';] [s|Lorem ipsum dolor]
pg.query.integer[,,SELECT pg_backend_pid();]  [u|3381]
pg.query.double[,,SELECT CAST(1234 AS double precision);] [d|1234.000000]
pg.query.discovery[,,SELECT * FROM pg_database;] [s|{
pg.backends.count                             [u|7]

Also, running a Zabbix Agent check from the commandline as the Zabbix user also shows a result:

$ sudo su -c "zabbix_agentd -t "pg.queries.longest" " -s /bin/bash zabbix 
zabbix_agentd [6099]: Starting agent module libzbxpgsql 0.2.1
pg.queries.longest                            [d|-0.001291]

The item prototypes on the Template, however, are all showing the error ZBX_NOTSUPPORTED and the Zabbix Agent log is also showing a lot of errors:

4076:20160108:140705.156 active check "pg.buffers_backend_fsync[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.162 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.163 active check "pg.backends.count[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.170 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.170 active check "pg.buffers_alloc[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.177 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.177 active check "pg.buffers_clean[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.184 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.184 active check "pg.buffers_backend[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.189 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.190 active check "pg.buffers_checkpoint[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.194 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.194 active check "pg.checkpoint_sync_time[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.202 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.202 active check "pg.checkpoint_write_time[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.207 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.207 active check "pg.queries.longest[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.212 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.212 active check "pg.maxwritten_clean[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.219 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.219 active check "pg.version[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.224 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.224 active check "pg.checkpoints_req[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.231 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.231 active check "pg.checkpoints_timed[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:140705.237 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:140705.237 active check "pg.stats_reset[host=127.0.0.1 port=5432 user=zabbix,zabbix]" is not supported
  4076:20160108:141205.654 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

  4076:20160108:141705.717 Failed to connect to PostgreSQL in pg_connect():
fe_sendauth: no password supplied

Any idea why when I can get that information directly via the Zabbix Agent, the Zabbix Template wouldn't be able to?

@cavaliercoder
Copy link
Collaborator

Firstly, thanks for taking a look at the existing issues before raising a new one. I agree this is not the same as #19.

The easiest way forward, since you are installed on the DB server, would be to tell the template to connect using Unix sockets. You should be able to connect with the default (blank) connection string set in the template. This is what zabbix_agentd -p uses.

When you call zabbix_agentd -p it uses the default connection string, which connects via Unix socket, not TCP/IP. It probably works because it would be using peer or ident auth for the local connection in your pg_hba.conf.

Your zabbix template on the other hand, is connecting via TCP/IP (host=127.0.0.1) and probably requires md5 password authentication. In this case, you must specify a password in the connection string, or more preferably, use a .pgpass file as per http://cavaliercoder.com/libzbxpgsql/agent-keys/#remote-monitoring-agent.

Please advise how you go.

@cavaliercoder cavaliercoder changed the title ZBX_NOTSUPPORTED items in host after template was added fe_sendauth: no password supplied Jan 9, 2016
@Wicaeed
Copy link
Author

Wicaeed commented Jan 9, 2016

:argh:

You are correct!

Had to have the .pgpass file for the agent to use in the default Zabbix agent user account home directory /var/run/zabbix.

Permanent fit was to change the Zabbix agent home directory to /home/zabbix (or something of your choosing) because the contents of /var/run are not permanent, then copy/paste the .pgpass file here and then restart the Zabbix agent

@cavaliercoder
Copy link
Collaborator

Excellent! Thanks for providing the answer.

@RanggaBasara
Copy link

i love u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants