From dc3815c0cc2111a929e6cfe338d4e0ad22ec9c46 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 21 Feb 2013 14:26:00 +0000 Subject: [PATCH] 2013-02-21 Sergio Martin * pandoradb_data.sql pandoradb.data.postgreSQL.sql pandoradb.data.oracle.sql extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Change a useless macro of internal event commands * include/functions_graph.php include/functions_events.php operation/agentes/estado_generalagente.php: Improve the layout of the agent detail view git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7696 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 15 +++ .../pandoradb_migrate_4.0.x_to_5.0.mysql.sql | 2 +- .../pandoradb_migrate_4.0.x_to_5.0.oracle.sql | 2 +- ...doradb_migrate_4.0.x_to_5.0.postgreSQL.sql | 2 +- pandora_console/include/functions_events.php | 21 ++++- pandora_console/include/functions_graph.php | 7 +- .../agentes/estado_generalagente.php | 91 ++++++++++--------- pandora_console/pandoradb.data.oracle.sql | 2 +- pandora_console/pandoradb.data.postgreSQL.sql | 2 +- pandora_console/pandoradb_data.sql | 2 +- 10 files changed, 93 insertions(+), 53 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 240aa779bc..f385ce58b7 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,18 @@ +2013-02-21 Sergio Martin + + * pandoradb_data.sql + pandoradb.data.postgreSQL.sql + pandoradb.data.oracle.sql + extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql + extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql + extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: Change a + useless macro of internal event commands + + * include/functions_graph.php + include/functions_events.php + operation/agentes/estado_generalagente.php: Improve the layout + of the agent detail view + 2013-02-21 Sergio Martin * extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql index f7cdedbbce..75bdab53d0 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql @@ -1085,7 +1085,7 @@ ALTER TABLE tserver DROP INDEX status; UPDATE talert_commands SET fields_descriptions = '["Destination address","Subject","Text","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 1; UPDATE talert_commands SET fields_descriptions = '["Description","","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 2; -UPDATE talert_commands SET fields_descriptions = '["Event text","Event type","Source","Agent name or _agent_","Event criticity","ID extra","Tags separated by commas","Comments","Not used","Not used"]', fields_values = '["","alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor","","","4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning","","","","",""]' WHERE id = 3; +UPDATE talert_commands SET fields_descriptions = '["Event text","Event type","Source","Agent name or _agent_","Event criticity","ID extra","Tags separated by commas","Comments","",""]', fields_values = '["","alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor","","","4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning","","","","",""]' WHERE id = 3; UPDATE talert_commands SET fields_descriptions = '["Log Info 1","Log Info 2","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 4; UPDATE talert_commands SET fields_descriptions = '["Community","Destination address","OID","Source address","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 5; UPDATE talert_commands SET fields_descriptions = '["Log Info 1","Log Info 2","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 6; diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql index 73d8c37f96..96a2bd0239 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql @@ -1089,7 +1089,7 @@ INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT UPDATE talert_commands SET fields_descriptions = '["Destination address","Subject","Text","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 1; UPDATE talert_commands SET fields_descriptions = '["Description","","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 2; -UPDATE talert_commands SET fields_descriptions = '["Event text","Event type","Source","Agent name or _agent_","Event criticity","ID extra","Tags separated by commas","Comments","Not used","Not used"]', fields_values = '["","alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor","","","4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning","","","","",""]' WHERE id = 3; +UPDATE talert_commands SET fields_descriptions = '["Event text","Event type","Source","Agent name or _agent_","Event criticity","ID extra","Tags separated by commas","Comments","",""]', fields_values = '["","alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor","","","4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning","","","","",""]' WHERE id = 3; UPDATE talert_commands SET fields_descriptions = '["Log Info 1","Log Info 2","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 4; UPDATE talert_commands SET fields_descriptions = '["Community","Destination address","OID","Source address","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 5; UPDATE talert_commands SET fields_descriptions = '["Log Info 1","Log Info 2","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 6; diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql index 1ff5ff2ec6..0757c955cc 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql @@ -1080,7 +1080,7 @@ INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM UPDATE "talert_commands" SET "fields_descriptions" = '["Destination address","Subject","Text","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 1; UPDATE "talert_commands" SET "fields_descriptions" = '["Description","","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 2; -UPDATE "talert_commands" SET "fields_descriptions" = '["Event text","Event type","Source","Agent name or _agent_","Event criticity","ID extra","Tags separated by commas","Comments","Not used","Not used"]', fields_values = '["","alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor","","","4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning","","","","",""]' WHERE id = 3; +UPDATE "talert_commands" SET "fields_descriptions" = '["Event text","Event type","Source","Agent name or _agent_","Event criticity","ID extra","Tags separated by commas","Comments","",""]', fields_values = '["","alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor","","","4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning","","","","",""]' WHERE id = 3; UPDATE "talert_commands" SET "fields_descriptions" = '["Log Info 1","Log Info 2","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 4; UPDATE "talert_commands" SET "fields_descriptions" = '["Community","Destination address","OID","Source address","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 5; UPDATE "talert_commands" SET "fields_descriptions" = '["Log Info 1","Log Info 2","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 6; diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 59a3423d9d..1a4959cbff 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -726,6 +726,7 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret echo '
'.__('No events').'
'; } else { + $table->id = 'latest_events_table'; $table->cellpadding = 4; $table->cellspacing = 4; $table->width = $width; @@ -820,7 +821,7 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret $data[4] = "".agents_get_name ($event["id_agente"]). ""; -// ui_print_agent_name ($event["id_agente"], true, 25, '', true); + // ui_print_agent_name ($event["id_agente"], true, 25, '', true); // for System or SNMP generated alerts } elseif ($event["event_type"] == "system") { @@ -837,9 +838,23 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret array_push ($table->data, $data); } - $return = html_print_table ($table, $return); + $events_table = html_print_table ($table, true); + $out = '
'; + $out .= $events_table; + $out .= ''; + $out .= '' . __('Events generated -by module-') . '
'; + $out .= graph_event_module (300, 120, $event['id_agente']); + $out .= '
'; + + unset ($table); - return $return; + + if($return) { + return $out; + } + else { + echo $out; + } } } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index fc1ee74496..dc8846f56a 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2312,7 +2312,12 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho for ($i = 0; $i < $interval; $i++) { $bottom = $datelimit + ($periodtime * $i); if (! $graphic_type) { - $name = date('H:i', $bottom); + if($config['flash_charts']) { + $name = date('H:i', $bottom); + } + else { + $name = date('H\h', $bottom); + } } else { $name = $bottom; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 6586cc44d5..503983a55b 100644 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -50,34 +50,8 @@ if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && !$is_extra) { return; } -$params = array(); -$params['position'] = 'right'; -$params['icon_closed'] = 'images/setup.png'; -$params['body_text'] = ''; - -if ($config["agentaccess"]) { - $params['body_text'] .= ''.__('Agent access rate (24h)').'
'; - - $params['body_text'] .= graphic_agentaccess($id_agente, 350, 110, 86400, true); -} - -$params['body_text'] .= '
 
'; -$params['body_text'] .= ''.__('Events generated -by module-').'
'; -$params['body_text'] .= graph_event_module (350, 120, $id_agente); - -$params['icon_closed'] = '/images/chart_curve'; -$params['icon_open'] = '/images/chart_curve'; -$params['height'] = '460px'; -$params['top'] = 'auto_below'; -$params['autotop'] = 'menu_tab_frame_view'; -$params['icon_width'] = 16; -$params['icon_height'] = 16; - -html_print_side_layer($params); - - $table->id = 'agent_datails'; -$table->width = '98%'; +$table->width = '100%'; $table->cellspacing = 4; $table->cellpadding = 4; $table->class = 'databox'; @@ -219,23 +193,54 @@ if ($agent['timezone_offset'] != 0) { $table->rowclass[] = ''; } -$data = array(); -$data[0] = '' . __('Modules status') . ''; -$data[1] = graph_agent_status ($id_agente, 120, 120, true); -$table->rowspan[count($table->data)][0] = 2; -$table->rowspan[count($table->data)][1] = 2; -$data[2] = '' . __('Agent status') . ''; -$status_img = agents_tree_view_status_img ($agent["critical_count"], - $agent["warning_count"], $agent["unknown_count"]); -$data[3] = $status_img; -$table->data[] = $data; -$table->rowclass[] = ''; +if($config["agentaccess"]) { + $data = array(); + $data[0] = '' . __('Agent access rate (24h)') . ''; + $data[1] = graphic_agentaccess($id_agente, 350, 110, 8640000, true); + $table->rowspan[count($table->data)][0] = 4; + $table->rowspan[count($table->data)][1] = 4; -$data = array(); -$data[0] = '' . __('Events (24h)') . ''; -$data[1] = graph_graphic_agentevents ($id_agente, 290, 15, 86400, '', true); -$table->data[] = $data; -$table->rowclass[] = ''; + $data[2] = '' . __('Agent status') . ''; + $status_img = agents_tree_view_status_img ($agent["critical_count"], + $agent["warning_count"], $agent["unknown_count"]); + $data[3] = $status_img; + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = array(); + $data[0] = '' . __('Modules status') . ''; + $data[1] = graph_agent_status ($id_agente, 120, 120, true); + $table->rowspan[count($table->data)][2] = 2; + $table->rowspan[count($table->data)][3] = 2; + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = array(); + $data[0] = '' . __('Events (24h)') . ''; + $data[1] = graph_graphic_agentevents ($id_agente, 290, 15, 86400, '', true); + $table->data[] = $data; + $table->rowclass[] = ''; +} +else { + $data = array(); + $data[0] = '' . __('Modules status') . ''; + $data[1] = graph_agent_status ($id_agente, 120, 120, true); + $table->rowspan[count($table->data)][0] = 3; + $table->rowspan[count($table->data)][1] = 3; + + $data[2] = '' . __('Agent status') . ''; + $status_img = agents_tree_view_status_img ($agent["critical_count"], + $agent["warning_count"], $agent["unknown_count"]); + $data[3] = $status_img; + $table->data[] = $data; + $table->rowclass[] = ''; + + $data = array(); + $data[0] = '' . __('Events (24h)') . ''; + $data[3] = graph_graphic_agentevents ($id_agente, 290, 15, 86400, '', true); + $table->data[] = $data; + $table->rowclass[] = ''; +} // Custom fields $fields = db_get_all_rows_filter('tagent_custom_fields', array('display_on_front' => 1)); diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index d1e5669bbd..dfff4c0991 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -29,7 +29,7 @@ BEGIN LOCK TABLE talert_commands IN EXCLUSIVE MODE; INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (1,'eMail','Internal type','This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using: _field1_ as destination email address, and _field2_ as subject for message. _field3_ as text of message.',1,'[\"Destination address\",\"Subject\",\"Text\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.',1,'[\"Description\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); -INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.',1,'[\"Event text\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event criticity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"Not used\",\"Not used\"]','[\"\",\"alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor\",\"\",\"\",\"4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning\",\"\",\"\",\"\",\"\",\"\"]'); +INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.',1,'[\"Event text\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event criticity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"\",\"\"]','[\"\",\"alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor\",\"\",\"\",\"4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log ',0,'[\"Log Info 1\",\"Log Info 2\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c _field1_ _field2_ _field3_ _field4_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.',0,'[\"Community\",\"Destination address\",\"OID\",\"Source address\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO talert_commands (id, name, command, description, internal, fields_descriptions, fields_values) VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.',0,'[\"Log Info 1\",\"Log Info 2\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index aa63a04d7c..05f9610d90 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -26,7 +26,7 @@ INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (1,'eMail','Internal type','This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using: _field1_ as destination email address, and _field2_ as subject for message. _field3_ as text of message.',1,'[\"Destination address\",\"Subject\",\"Text\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.',1,'[\"Description\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); -INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.',1,'[\"Event text\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event criticity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"Not used\",\"Not used\"]','[\"\",\"alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor\",\"\",\"\",\"4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning\",\"\",\"\",\"\",\"\",\"\"]'); +INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.',1,'[\"Event text\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event criticity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"\",\"\"]','[\"\",\"alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor\",\"\",\"\",\"4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log ',0,'[\"Log Info 1\",\"Log Info 2\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c _field1_ _field2_ _field3_ _field4_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.',0,'[\"Community\",\"Destination address\",\"OID\",\"Source address\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal", "fields_descriptions", "fields_values") VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.',0,'[\"Log Info 1\",\"Log Info 2\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 71a255f6ae..9e16aefc6a 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -14,7 +14,7 @@ INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (1,'eMail','Internal type','This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using: _field1_ as destination email address, and _field2_ as subject for message. _field3_ as text of message.',1,'[\"Destination address\",\"Subject\",\"Text\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.',1,'[\"Description\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); -INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.',1,'[\"Event text\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event criticity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"Not used\",\"Not used\"]','[\"\",\"alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor\",\"\",\"\",\"4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning\",\"\",\"\",\"\",\"\",\"\"]'); +INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.',1,'[\"Event text\",\"Event type\",\"Source\",\"Agent name or _agent_\",\"Event criticity\",\"ID extra\",\"Tags separated by commas\",\"Comments\",\"\",\"\"]','[\"\",\"alert_ceased,Alert ceased;alert_fired,Alert fired;alert_manual_validation,Alert manual validation;alert_recovered,Alert recovered;configuration_change,Configuration change ;error,Error;critical,Monitor Critical;normal,Monitor Normal;going_unknown,Monitor\",\"\",\"\",\"4,Critical;1,Informational;0,Maintenance;6,Major;5,Minor;2,Normal;3,Warning\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log ',0,'[\"Log Info 1\",\"Log Info 2\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c _field1_ _field2_ _field3_ _field4_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.',0,'[\"Community\",\"Destination address\",\"OID\",\"Source address\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]'); INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`, `fields_descriptions`, `fields_values`) VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.',0,'[\"Log Info 1\",\"Log Info 2\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]','[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"]');