zabbix-tools / libzbxpgsql

Monitor PostgreSQL with Zabbix
http://cavaliercoder.com/libzbxpgsql/
Other
157 stars 64 forks source link

FATAL: database "root" does not exist #27

Closed evanbechtol closed 8 years ago

evanbechtol commented 8 years ago

Attempting to implement on Zabbix Server & Agent 2.4.4

Here is an example of a item argument: pg.db.discovery[host=(server ip) port=(postgresql port) connect_timeout=10,zabbix]

I have created the role "zabbix" to allow zabbix to connect to postgresql and mapped it to the DB, zabbix.

I updated the pg_hba.conf file as well as the pg_ident.conf file.

When configuring the template for use after installation, I am receiving the following error when using the command: zabbix_agentd -p | grep '^pg.'


zabbix_agentd [32343]: Starting agent module libzbxpgsql 0.2.1 zabbix_agentd [32343]: Warning: Executing command 'echo test' pg.modver [s|libzbxpgsql 0.2.1] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.connect [u|0] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.version [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.starttime [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.uptime [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.setting[,,data_directory] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.setting.discovery [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.query.string[,,SELECT 'Lorem ipsum dolor';] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.query.integer[,,SELECT pg_backend_pid();] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.query.double[,,SELECT CAST(1234 AS double precision);] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.query.discovery[,,SELECT * FROM pg_database;] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.backends.count [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.queries.longest [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.checkpoints_timed [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.checkpoints_req [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.checkpoint_write_time [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.checkpoint_sync_time [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.buffers_checkpoint [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.buffers_clean [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.maxwritten_clean [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.buffers_backend [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.buffers_backend_fsync [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.buffers_alloc [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.stats_reset [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.discovery [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.namespace.discovery [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.schema.discovery [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.tablespace.discovery [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.discovery [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.children.discovery[,,pg_proc] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.index.discovery [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.size [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.size [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.rows [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.children[,,pg_database] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.children.size[,,pg_database] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.children.rows[,,pg_database] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.index.size [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.index.rows [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.tablespace.size[,,pg_default] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.namespace.size[,,pg_catalog] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.schema.size[,,pg_catalog] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.numbackends [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.xact_commit [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.xact_rollback [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.blks_read [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.blks_hit [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.tup_returned [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.tup_fetched [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.tup_inserted [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.tup_updated [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.tup_deleted [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.conflicts [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.temp_files [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.temp_bytes [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.deadlocks [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.blk_read_time [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.blk_write_time [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.db.stats_reset[,,postgres,,,] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.seq_scan [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.seq_tup_read [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.idx_scan [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.idx_tup_fetch [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.n_tup_ins [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.n_tup_upd [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.n_tup_del [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.n_tup_hot_upd [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.n_live_tup [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.n_dead_tup [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.last_vacuum[,,pg_database] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.last_autovacuum[,,pg_database] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.last_analyze[,,pg_database] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.last_autoanalyze[,,pg_database] [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.vacuum_count [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.autovacuum_count [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.analyze_count [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.autoanalyze_count [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.heap_blks_read [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.heap_blks_hit [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.idx_blks_read [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.idx_blks_hit [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.toast_blks_read [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.toast_blks_hit [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.tidx_blks_read [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.table.tidx_blks_hit [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.index.idx_scan [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.index.idx_tup_read [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.index.idx_tup_fetch [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.index.idx_blks_read [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [32343]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.index.idx_blks_hit [m|ZBX_NOTSUPPORTED] [Item is not supported.]

cavaliercoder commented 8 years ago

Thanks for logging this issue. Hopefully we can get it fixed.

I'm unclear where you are seeing the pasted error log. You've said it's the output from zabbix_agentd -p | grep '^pg.' but it looks like content from the agent logs. Can you please clarify the following:

From the information above, it looks like the Zabbix agent is running as root and you are attempting to connect using Unix sockets (not TCP) with peer or ident authentication. If you intend to run the agent as root, but connect to the PostgreSQL server as zabbix, you need to map the root identity to the zabbix role if your pg_ident.conf file. E.g:

# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
zabbix                  root                                       zabbix

You then also need to specify the username in your connection string (E.g. user=zabbix). By default this is set in the {$PG_CONN} macro for the PostgreSQL monitoring template.

Restart/reload your PostgreSQL server to refresh the configuration.

If I've understood your scenario correctly, please give this a try and advise the outcome.

evanbechtol commented 8 years ago

Here is an example of zabbix_agentd.log output:

10545:20151222:204651.979 Failed to connect to PostgreSQL in pg_connect(): fe_sendauth: no password supplied

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


Here is the results of running the command: sudo zabbix_agentd -p | grep '^pg.' [....]$ sudo zabbix_agentd -p | grep '^pg.' [sudo] password for .....: zabbix_agentd [9429]: Starting agent module libzbxpgsql 0.2.1 zabbix_agentd [9429]: Warning: Executing command 'echo test' pg.modver [s|libzbxpgsql 0.2.1] zabbix_agentd [9429]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.connect [u|0] zabbix_agentd [9429]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.version [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [9429]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist

pg.starttime [m|ZBX_NOTSUPPORTED] [Item is not supported.] zabbix_agentd [9429]: Error: Failed to connect to PostgreSQL in pg_connect(): FATAL: database "root" does not exist ........ pg.index.idx_blks_hit [m|ZBX_NOTSUPPORTED] [Item is not supported.] pgsql.get.pg.transactions [t|sh: /pgsql_server_funcs.sh: No such file or directory] pgsql.get.pg.bgwriter [t|sh: /pgsql_server_funcs.sh: No such file or directory] pgsql.get.pg.slow_query [t|sh: /pgsql_server_funcs.sh: No such file or directory] pgsql.get.pg.stat_database [t|sh: /pgsql_db_funcs.sh: No such file or directory] pgsql.get.pg.size [t|sh: /pgsql_userdb_funcs.sh: No such file or directory] pgsql.get.pg.stat_table [t|sh: /pgsql_tbl_funcs.sh: No such file or directory] pgsql.get.pg.stat_replication [t|sh: /pgsql_sr_server_funcs.sh: No such file or directory] pgsql.get.pg.sr.status [t|sh: /pgsql_sr_server_funcs.sh: No such file or directory] pgpool.running [t|sh: /pgpool_simple.sh: No such file or directory] pgpool.have_delegate_ip [t|sh: /pgpool_delegate_ip.sh: No such file or directory] pgpool.get.nodes [t|sh: /pgpool_backend_status.sh: No such file or directory] pgpool.get.connections [t|sh: /pgpool_connections.sh: No such file or directory] pgpool.get.cache [t|sh: /pgpool_cache.sh: No such file or directory]


The Zabbix web console shows the error "Item is not supported."


The added line in pg_hba.conf: local all root ident map=root local zabbix zabbix md5

The added line in pg_ident.conf: root zabbix root root root root


My {$PG_CONN} macro in Zabbix web interface, specified under the host: host=127.0.0.1 port=5432 user=zabbix

evanbechtol commented 8 years ago

I have updated my {$PG_CONN} macro in Zabbix web interface, specified under the host to the following: host=127.0.0.1 port=5432 user=zabbix password=(password for this user)

I have also updated my pg_ident.conf file to match the configuration that you had specified above.

I now have most of the items successfully being collected by the Zabbix agent and the connection is successful after following your directions. There are a few still becoming unsupported. Will update as more information is available.

I believe that the main cause of the problem was that my pg_ident.conf file was configured incorrectly, and my {$PG_CONN} macro was also missing the "password" key/value pair

cavaliercoder commented 8 years ago

Excellent thank you!

Your pg_hba.conf should look like:

local all zabbix peer map=zabbix

Your pg_ident.conf should look like:

zabbix root zabbix

You should also omit host and port from your connection string, or set it to the local socket path (E.g. host=/tmp) instead of TCP/IP. If you want to use TCP/IP with md5 auth, you need to specify a password in your connection string or ~/.pgpass file.

If you configure the above setup:

If you then see the database "foo" does not exist error, it is because PostgreSQL, by default, assumes the database you wish to connect to has the same name as the connected user. To fix this, simply specify the desired database in the second parameter of your item keys (or the provided {$PG_DB} macro).

cavaliercoder commented 8 years ago

For further clarity, please see:

evanbechtol commented 8 years ago

Everything is now working as expected! :dancers:

Thank you very much for your help, for this template and rpm. I believe that this issue can be closed at this point. Great work :+1:

cavaliercoder commented 8 years ago

You're welcome. Thanks for the feedback!

buzzing-bee commented 5 years ago

Everything is now working as expected! 👯

Thank you very much for your help, for this template and rpm. I believe that this issue can be closed at this point. Great work 👍

how did it work bro? what changes that you made ??