From b79601898e282f70cbe987bbde7d38a53fff4d82 Mon Sep 17 00:00:00 2001 From: slerena Date: Wed, 17 Aug 2011 20:14:56 +0000 Subject: [PATCH] 2011-08-17 Sancho lerena * pandoradb.oracle.sql, pandoradb.postgreSQL.sql, extras/pandoradb_migrate_v3.2_to_v4.0.sql, pandoradb.sql: custom_oid now is text instead varchar(200). This allows alerts with huge regexp inside :-) * operation/snmpconsole/snmp_view.php: Custom info now is shown in only one label (Custom Data). Minor changes on layout. * godmode/snmpconsole/snmp_alert.php: Added help, resized controls and some other minor adjustments. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4762 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 14 ++++++++++++ .../extras/pandoradb_migrate_v3.2_to_v4.0.sql | 10 +++++++++ .../godmode/snmpconsole/snmp_alert.php | 22 ++++++++++++------- .../operation/snmpconsole/snmp_view.php | 18 +++++++++------ pandora_console/pandoradb.oracle.sql | 2 +- pandora_console/pandoradb.postgreSQL.sql | 2 +- pandora_console/pandoradb.sql | 2 +- 7 files changed, 52 insertions(+), 18 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a68af67031..e5ff9a9ad0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2011-08-17 Sancho lerena + + * pandoradb.oracle.sql, + pandoradb.postgreSQL.sql, + extras/pandoradb_migrate_v3.2_to_v4.0.sql, + pandoradb.sql: custom_oid now is text instead varchar(200). + This allows alerts with huge regexp inside :-) + + * operation/snmpconsole/snmp_view.php: Custom info now is + shown in only one label (Custom Data). Minor changes on layout. + + * godmode/snmpconsole/snmp_alert.php: Added help, resized controls + and some other minor adjustments. + 2011-08-17 Miguel de Dios * include/functions_html.php, include/functions_networkmap.php, diff --git a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql index 048809e8ea..818182930f 100644 --- a/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql +++ b/pandora_console/extras/pandoradb_migrate_v3.2_to_v4.0.sql @@ -237,6 +237,16 @@ ALTER TABLE tserver_export ADD INDEX id_export_server (`id_export_server`); ALTER TABLE ttrap ADD INDEX timestamp (`timestamp`); ALTER TABLE ttrap ADD INDEX status (`status`); +-- ----------------------------------------------------- +-- Table `talert_snmp` +-- ----------------------------------------------------- + +ALTER TABLE `talert_snmp` MODIFY COLUMN `custom_oid` text DEFAULT ''; + + +ALTER TABLE ttrap ADD INDEX timestamp (`timestamp`); + + -- ----------------------------------------------------- -- Table `tconfig_os` -- ----------------------------------------------------- diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 8906ecd5f8..c101297493 100644 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -185,26 +185,32 @@ if (isset ($_GET["update_alert"])) { // OID echo ''.__('OID').''; - html_print_input_text ("oid", $oid, '', 30); + html_print_input_text ("oid", $oid, '', 50); echo ''; - // OID Custom - echo ''.__('Custom Value')."/".__("OID").''; - html_print_input_text ("custom_value", $custom_value, '', 30); + // Custom + echo ''.__('Custom data'); + echo ui_print_help_icon ("snmp_alert_custom", true); + + echo ''; + html_print_textarea ("custom_value", $custom_value, 2, $custom_value, 'style="width:400px;"'); + echo ''; // SNMP Agent echo ''.__('SNMP Agent').' (IP)'; - html_print_input_text ("source_ip", $source_ip, '', 30); + html_print_input_text ("source_ip", $source_ip, '', 20); echo ''; // Alert fields - echo ''.__('Field #1 (Alias, name)').''; - html_print_input_text ("al_field1", $al_field1, '', 50); + echo ''.__('Field #1 (Alias, name)'); + echo ui_print_help_icon ("snmp_alert_field1", true); + echo ''; + html_print_input_text ("al_field1", $al_field1, '', 60); echo ''; echo ''.__('Field #2 (Single Line)').''; - html_print_input_text ("al_field2", $al_field2, '', 50); + html_print_input_text ("al_field2", $al_field2, '', 60); echo ''; echo ''.__('Field #3 (Full Text)').''; diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index f82cfdac46..1143d91410 100644 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -428,10 +428,10 @@ if ($traps !== false) { } //Custom - if (empty ($trap["value_custom"])) { + if (empty ($trap["oid_custom"])) { $data[4] = __('N/A'); } else { - $data[4] = ui_print_truncate_text($trap["value_custom"], 15, false); + $data[4] = ui_print_truncate_text($trap["oid_custom"], 25, false); } //User @@ -474,11 +474,15 @@ if ($traps !== false) { //Hiden file for description $string = ' - ' - . '' - . '' - . '' - . '
' . __('Custom OID:') . '' . $trap['oid_custom'] . '
' . '' . __('OID:') . ' ' . $trap['oid'] . '
' . '' . __('Value Custom:') . ' ' . $trap['value_custom'] . '
' . '' . __('Description:') . '' . $trap['description'] . '
'; + ' . __('Custom data:') . '' . $trap['oid_custom'] . '' + . '' . '' . __('OID:') . ' ' . $trap['oid'] . ''; + + if ($trap["description"] != ""){ + $string .= '' . '' . __('Description:') . '' . $trap['description'] . ''; + } + + $string .= ''; + $data = array($string); //$data = array($trap['description']); $idx++; $table->rowclass[$idx] = 'trap_info_' . $trap['id_trap']; diff --git a/pandora_console/pandoradb.oracle.sql b/pandora_console/pandoradb.oracle.sql index 33d9be70d7..7f19208ebe 100644 --- a/pandora_console/pandoradb.oracle.sql +++ b/pandora_console/pandoradb.oracle.sql @@ -234,7 +234,7 @@ CREATE TABLE talert_snmp ( description VARCHAR2(255) default '', alert_type NUMBER(5, 0) default 0 NOT NULL, agent VARCHAR2(100) default '', - custom_oid VARCHAR2(200) default '', + custom_oid CLOB default '', oid VARCHAR2(255) default '', time_threshold NUMBER(10, 0) default 0 NOT NULL, times_fired NUMBER(5, 0) default 0 NOT NULL, diff --git a/pandora_console/pandoradb.postgreSQL.sql b/pandora_console/pandoradb.postgreSQL.sql index 787c52e647..4977a34017 100644 --- a/pandora_console/pandoradb.postgreSQL.sql +++ b/pandora_console/pandoradb.postgreSQL.sql @@ -216,7 +216,7 @@ CREATE TABLE "talert_snmp" ( "description" varchar(255) default '', "alert_type" SMALLINT NOT NULL default 0, "agent" varchar(100) default '', - "custom_oid" varchar(200) default '', + "custom_oid" text default '', "oid" varchar(255) NOT NULL default '', "time_threshold" INTEGER NOT NULL default 0, "times_fired" SMALLINT NOT NULL default 0, diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 09a1f4aec9..32c8aa1ddc 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -214,7 +214,7 @@ CREATE TABLE IF NOT EXISTS `talert_snmp` ( `description` varchar(255) default '', `alert_type` int(2) unsigned NOT NULL default '0', `agent` varchar(100) default '', - `custom_oid` varchar(200) default '', + `custom_oid` text default '', `oid` varchar(255) NOT NULL default '', `time_threshold` int(11) NOT NULL default '0', `times_fired` int(2) unsigned NOT NULL default '0',