Skip to main content

Parámetros

Parámetro Descripción
-d,--database Nombre de la base de datos (obligatorio)
-u,--user Nombre del user de postgreSQL(obligatorio)
-p,-password Password de postgreSQL (obligatorio)
-i,--ip ip del server (obligatorio)
--port puerto del server. Por defecto 5432 (opcional)
--tentacle_port Puerto de tentacle.Por defecto 41121(opcional)
--tentacle_address Ip del servidor tentacle al que mandar los datos(opcional)
--agent_name Para ponerle un nombre al agente que contendrá los módulos de las custom querys, por defecto : "PostgreSQL". (opcional)
--prefix_module Para ponerle un prefijo a los módulos por si se quieren diferenciar de otras ejecuciones.(opcional)
--conf Path del archivo conf con las querys (obligatorio)
-g,--group Grupo de destino de Pandora FMS (opcional)
--data_dir Directorio de datos de Pandora FMS. Por defecto es /var/spool/pandora/data_in/ (opcional)
--as_agent_plugintransfer_mode Es opcional, si quieres que el plugin seaMétodo de agentetransferencia y te metade los módulosXML, enlas eldos agenteopciones deposibles pandora,son: ejecutatentacle estoo con un 1 (opcional)local.

 

Pandora_postgresql.conf

En este archivo se introducirán las querys que crearán módulos en PandoraFMS. 

El formato para añadir las querys es el siguiente:

nombre_modulo:query:tipo:descripción

* La descripción no es obligatoria, si no se introduce se quedará vacía.

Ejemplo:

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