2011-08-17 Sancho lerena <slerena@artica.es>

* 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
This commit is contained in:
slerena 2011-08-17 20:14:56 +00:00
parent df6d922a69
commit b79601898e
7 changed files with 52 additions and 18 deletions

View File

@ -1,3 +1,17 @@
2011-08-17 Sancho lerena <slerena@artica.es>
* 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 <miguel.dedios@artica.es>
* include/functions_html.php, include/functions_networkmap.php,

View File

@ -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`
-- -----------------------------------------------------

View File

@ -185,26 +185,32 @@ if (isset ($_GET["update_alert"])) {
// OID
echo '<tr id="tr-oid"><td class="datos2">'.__('OID').'</td><td class="datos2">';
html_print_input_text ("oid", $oid, '', 30);
html_print_input_text ("oid", $oid, '', 50);
echo '</td></tr>';
// OID Custom
echo '<tr id="tr-custom_value"><td class="datos">'.__('Custom Value')."/".__("OID").'</td><td class="datos">';
html_print_input_text ("custom_value", $custom_value, '', 30);
// Custom
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom data');
echo ui_print_help_icon ("snmp_alert_custom", true);
echo '</td><td class="datos">';
html_print_textarea ("custom_value", $custom_value, 2, $custom_value, 'style="width:400px;"');
echo '</td></tr>';
// SNMP Agent
echo '<tr id="tr-source_ip"><td class="datos2">'.__('SNMP Agent').' (IP)</td><td class="datos2">';
html_print_input_text ("source_ip", $source_ip, '', 30);
html_print_input_text ("source_ip", $source_ip, '', 20);
echo '</td></tr>';
// Alert fields
echo '<tr><td class="datos">'.__('Field #1 (Alias, name)').'</td><td class="datos">';
html_print_input_text ("al_field1", $al_field1, '', 50);
echo '<tr><td class="datos">'.__('Field #1 (Alias, name)');
echo ui_print_help_icon ("snmp_alert_field1", true);
echo '</td><td class="datos">';
html_print_input_text ("al_field1", $al_field1, '', 60);
echo '</td></tr>';
echo '<tr><td class="datos2">'.__('Field #2 (Single Line)').'</td><td class="datos2">';
html_print_input_text ("al_field2", $al_field2, '', 50);
html_print_input_text ("al_field2", $al_field2, '', 60);
echo '</td></tr>';
echo '<tr><td class="datos" valign="top">'.__('Field #3 (Full Text)').'<td class="datos">';

View File

@ -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 = '<table border="0" width="90%">
<tr><td align="left" valign="top" width="15%"><b>' . __('Custom OID:') . '</b></td><td align="left">' . $trap['oid_custom'] . '</td></tr>'
. '<tr><td align="left" valign="top">' . '<b>' . __('OID:') . '</td><td align="left"> ' . $trap['oid'] . '</td></tr>'
. '<tr><td align="left" valign="top">' . '<b>' . __('Value Custom:') . '</td><td align="left"> ' . $trap['value_custom'] . '</td></tr>'
. '<tr><td align="left" valign="top">' . '<b>' . __('Description:') . '</td><td align="left">' . $trap['description'] . '</td></tr>'
. '</table>';
<tr><td align="left" valign="top" width="15%"><b>' . __('Custom data:') . '</b></td><td align="left">' . $trap['oid_custom'] . '</td></tr>'
. '<tr><td align="left" valign="top">' . '<b>' . __('OID:') . '</td><td align="left"> ' . $trap['oid'] . '</td></tr>';
if ($trap["description"] != ""){
$string .= '<tr><td align="left" valign="top">' . '<b>' . __('Description:') . '</td><td align="left">' . $trap['description'] . '</td></tr>';
}
$string .= '</table>';
$data = array($string); //$data = array($trap['description']);
$idx++;
$table->rowclass[$idx] = 'trap_info_' . $trap['id_trap'];

View File

@ -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,

View File

@ -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,

View File

@ -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',