I configured netdata to monitor Postgresql and it is giving these errors in the log, I ran GRANT SELECT ON ALL TABLES IN SCHEMA pgagent TO netdata; in the postgres table but not resolved.
2022-11-07 10:00:02.245 -03 [1107866] netdata@postgres ERROR: permission denied for schema pgagent
2022-11-07 10:00:02.245 -03 [1107866] netdata@postgres STATEMENT:
SELECT current_database() as dataname,
schemaname,
relname,
seq_scan,
seq_tup_read,
idx_scan,
idx_tup_fetch,
n_tup_ins,
n_tup_upd,
n_tup_del,
n_tup_hot_upd,
n_live_tup,
n_dead_tup,
EXTRACT(epoch from now() - last_vacuum) as last_vacuum,
EXTRACT(epoch from now() - last_autovacuum) as last_autovacuum,
EXTRACT(epoch from now() - last_analyze) as last_analyze,
EXTRACT(epoch from now() - last_autoanalyze) as last_autoanalyze,
vacuum_count,
autovacuum_count,
analyze_count,
autoanalyze_count,
pg_total_relation_size(schemaname || ‘.’ || relname) as total_relation_size
FROM pg_stat_user_tables;
@Rodrigo_Buch Hmm, this is weird. I wonder if it could have something to do with this.
System/database access - all jobs run by pgAgent will run with the security privileges of the pgAgent user. SQL steps will run as the user that pgAgent connects to the database as, and batch/shell scripts will run as the operating system user that the pgAgent service or daemon is running under. Because of this, it is essential to maintain control over the users that are able to create and modify jobs. By default, only the user that created the pgAgent database objects will be able to do this - this will normally be the PostgreSQL superuser.