Skip to main content

Parameters

Parámetro Descripción
-d,--database NombreDatabase de la base de datosname (obligatorio)required)
-u,--user NombreName delof userthe depostgreSQL postgreSQL(obligatorio)user(required)
-p,-password Password de postgreSQL password (obligatorio)required)
-i,--ip server ip del server (obligatorio)required)
--port puertoserver delport. server. Por defectoDefault 5432 (opcional)optional)
--tentacle_port PuertoTentacle deport tentacle.Por(default defecto 41121(opcional)41121)(optional)
--tentacle_address Ip delof servidorthe tentacle alserver queto mandarsend losthe datos(opcional)data (optional)
--agent_name ParaTo ponerlename unthe nombreagent althat agentewill quecontain contendrá los módulos de lasthe custom querys,queries pormodules, defectoby :default: "PostgreSQL". (opcional)optional).
--prefix_module ParaTo ponerleprefix unthe prefijomodules ain loscase módulosyou porwant sito sedifferentiate quierenthem diferenciasfrom deother otrasexecutions ejecuciones.(opcional)optional).
--conf Path delof archivothe conf confile laswith querysthe queries (obligatorio)required)
-g,--group Grupo de destino de Pandora FMS target group (opcional)optional)
--data_dir Directorio de datos de Pandora FMS. PorFMS defecto esdata directory. By default it is /var/spool/pandora/data_in/ (opcional)optional)
--as_agent_plugin EsIt opcional,is sioptional, quieresif queyou elwant the plugin seato debe agentean yagent teplugin metaand losput módulosthe enmodules elin agentethe depandora pandora,agent, ejecutaexecute estothis conwith una 1 (opcional)optional)

Pandora_postgresql.conf

In this file the queries that will create modules in PandoraFMS will be introduced.

The format to add the queries is the following:

nombre_modulo:query:tipo:descripción

* The description is not mandatory, if not entered it will remain empty.

Example:

 

number_connections:SELECT count(*) FROM pg_stat_activity;:generic_data:Number of Connections or running backend
connections_waiting_in_locks:SELECT count(*) FROM pg_stat_activity WHERE wait_event = 'Lock';:generic_data:Number of connections/backends waiting on locks
connections_idle_in_transaction:SELECT count(*) FROM pg_stat_activity WHERE wait_event = 'idle in transaction';:generic_data:Number of backends in a transaction, but are currently not doing anything and could be waiting for an input from the end user.
number_users:SELECT COUNT(usename) FROM pg_stat_activity;:generic_data:Number users conected in postgreSQL
number_roles:SELECT count(*) FROM pg_roles;:generic_data:A role can be thought of as either a database user, or a group of database users, depending on how the role is set up.
psql_version:SELECT version();:generic_data_string:PostgrSQL version
num_blocks:SELECT COUNT(*) FROM pg_locks;:generic_data:A high number of deadlocks indicates that there is a higher probability that two or more processes will attempt to access the same resource.
number_commits:SELECT sum(xact_commit) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname) WHERE db.datname = _database_;:generic_data:Number of commits the current transaction. All changes made by the transaction become visible to others and are guaranteed to be durable if a crash occurs.
number_rollbacks:SELECT sum(xact_rollback) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname) WHERE db.datname = _database_;:generic_data:This metric represents the number of times, per transaction during the sample period, that users manually issue the ROLLBACK statement or an error occurred during a user's transactions.
tuples_returned:SELECT sum(tup_returned) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname) WHERE db.datname = _database_;:generic_data:Number of rows returned by queries in this database
tuples_searched:SELECT sum(tup_fetched) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname )WHERE db.datname = _database_;:generic_data:Number of tuples searched
tuples_inserted:SELECT sum(tup_inserted) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname) WHERE db.datname = _database_;:generic_data:Number of rows inserted into table
tuples_updated:SELECT sum(tup_updated) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname) WHERE db.datname = _database_;:generic_data:Number of tuples updated
tuples_removed:SELECT sum(tup_deleted) FROM (pg_database AS db JOIN pg_stat_database sdb ON db.datname=sdb.datname) WHERE db.datname = _database_;:generic_data:Number of tuples removed
state:SELECT state FROM pg_stat_activity WHERE datname = _database_;:generic_data_string:Database status
number_databases_list:select * from pg_database;:generic_data_string