Skip to main content

Módulos generados por el plugin

El plugin creará un agente con el nombre que le hayamos puesto con el parámetro "--agent_name" si no se usa este parámetro se quedara con "PostgreSQL" por defecto:

image-1646651418504.pngimage-1646739709089.png

En este agente se crearán un módulo por cada consulta personalizada especificada en pandora_postgresql.conf, con el nombre que le hayamos asignado a cada una de estas.

Por ejemplo el siguiente conf:

number_connections:SELECT count(*) FROM pg_stat_activity;
connections_waiting_in_locks:SELECT count(*) FROM pg_stat_activity WHERE wait_event = 'Lock';
connections_idle_in_transaction:SELECT count(*) FROM pg_stat_activity WHERE wait_event = 'idle in transaction';
number_users:SELECT COUNT(usename) FROM pg_stat_activity;
number_roles:SELECT count(*) FROM pg_roles;
psql_version:SELECT version() ;
num_blocks:SELECT COUNT(*) FROM pg_locks;
psql_diskspace:SELECT ROUND(SUM(pg_database_size(oid))/1024/1024) FROM pg_database;
number_commits:SELECT sum(xact_commit) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname);
number_rollbacks:SELECT sum(xact_rollback) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname);
tuples_returned:SELECT sum(tup_returned) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname);
tuples_searched:SELECT sum(tup_fetched) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname);
tuples_inserted:SELECT sum(tup_inserted) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname);
tuples_updated:SELECT sum(tup_updated) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname);
tuples_removed:SELECT sum(tup_deleted) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname);

Creará los siguientes módulos:

image-1646738489261.png