From d081b658fa2b93fe8385d5f9fd6a21929f89940a Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 23 Dec 2010 19:21:09 +0000 Subject: [PATCH] 2010-12-23 Miguel de Dios * pandoradb_data.sql: added custom sql for reports a some sqls querys: Monitoring Report Agent, Monitoring Report Modules and Monitoring Report Alerts. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3705 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/pandoradb_data.sql | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 60154f451d..626cbccdf0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-12-23 Miguel de Dios + + * pandoradb_data.sql: added custom sql for reports a some sqls querys: + Monitoring Report Agent, Monitoring Report Modules and + Monitoring Report Alerts. + 2010-12-23 Miguel de Dios * include/functions.php: cleaned source code style. diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 97befdc589..550f554b35 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -396,3 +396,7 @@ INSERT INTO `talert_templates` VALUES (2,'Manual alert','This is a template INSERT INTO `talert_templates` VALUES (3,'Warning condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS This alert has been fired because a WARNING condition in one of your monitored items: Agent : _agent_ Module: _module_ Module description: _moduledescription_ Timestamp _timestamp_ Current value: _data_ Thanks for your time. Best regards Pandora FMS ','warning','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS This alert has been RECOVERED from a WARNING condition in one of your monitored items: Agent : _agent_ Module: _module_ Module description: _moduledescription_ Timestamp _timestamp_ Current value: _data_ Thanks for your time. Best regards Pandora FMS ',3,0); +-- treport_custom_sql Data +INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (1, 'Monitoring Report Agent', 'select direccion, nombre, comentarios, (select nombre from tgrupo where tgrupo.id_grupo = tagente.id_grupo) as `group` from tagente;'); +INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (2, 'Monitoring Report Modules', 'select (select tagente.nombre from tagente where tagente.id_agente = tagente_modulo.id_agente) as agent_name, nombre , (select tmodule_group.name from tmodule_group where tmodule_group.id_mg = tagente_modulo.id_module_group) as module_group, module_interval from tagente_modulo where delete_pending = 0 order by agent_name;'); +INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (3, 'Monitoring Report Alerts', 'select t1.nombre as agent_name, t2.nombre as module_name, (select talert_templates.name from talert_templates where talert_templates.id = t3.id_alert_template) as template, (select group_concat(t02.name) from talert_template_module_actions as t01 inner join talert_actions as t02 on t01.id_alert_action = t02.id where t01.id_alert_template_module = t3.id group by t01.id_alert_template_module) as actions from tagente as t1 inner join tagente_modulo as t2 on t1.id_agente = t2.id_agente inner join talert_template_modules as t3 on t2.id_agente_modulo = t3.id_agent_module order by agent_name, module_name;');