2014-03-27 Vanessa Gil <vanessa.gil@artica.es>
* pandoradb.oracle.sql pandoradb.postgreSQL.sql pandoradb.sql extras/pandoradb_migrate_5.0_to_5.1.mysql.sql extras/pandoradb_migrate_5.0_to_5.1.oracle.sql extras/pandoradb_migrate_5.0_to_5.1.postgreSQL.sql godmode/snmpconsole/snmp_alert.php operation/snmpconsole/snmp_view.php: Add fields 'order_x' to SNMP Traps. * images/help/custom_oid.png images/help/custom_oid2.png images/help/trap.png: Added images. * include/help/en/help_field_match_snmp.php include/help/es/help_field_match_snmp.php: Changed help. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9651 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
84867bc2dc
commit
7a3aa1d6ff
|
@ -1,3 +1,22 @@
|
|||
2014-03-27 Vanessa Gil <vanessa.gil@artica.es>
|
||||
|
||||
* pandoradb.oracle.sql
|
||||
pandoradb.postgreSQL.sql
|
||||
pandoradb.sql
|
||||
extras/pandoradb_migrate_5.0_to_5.1.mysql.sql
|
||||
extras/pandoradb_migrate_5.0_to_5.1.oracle.sql
|
||||
extras/pandoradb_migrate_5.0_to_5.1.postgreSQL.sql
|
||||
godmode/snmpconsole/snmp_alert.php
|
||||
operation/snmpconsole/snmp_view.php: Add fields 'order_x'
|
||||
to SNMP Traps.
|
||||
|
||||
* images/help/custom_oid.png
|
||||
images/help/custom_oid2.png
|
||||
images/help/trap.png: Added images.
|
||||
|
||||
* include/help/en/help_field_match_snmp.php
|
||||
include/help/es/help_field_match_snmp.php: Changed help.
|
||||
|
||||
2014-03-24 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/massive/massive_edit_modules.php,
|
||||
|
|
|
@ -84,3 +84,27 @@ ALTER TABLE `tnetwork_map` ADD COLUMN `l2_network` tinyint(1) unsigned NOT NULL
|
|||
-- Table `tlayout_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `tlayout_data` ADD COLUMN `id_group` INTEGER UNSIGNED NOT NULL default 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `talert_snmp`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_1` int(10) unsigned NOT NULL default 1;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_2` int(10) unsigned NOT NULL default 2;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_3` int(10) unsigned NOT NULL default 3;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_4` int(10) unsigned NOT NULL default 4;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_5` int(10) unsigned NOT NULL default 5;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_6` int(10) unsigned NOT NULL default 6;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_7` int(10) unsigned NOT NULL default 7;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_8` int(10) unsigned NOT NULL default 8;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_9` int(10) unsigned NOT NULL default 9;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_10` int(10) unsigned NOT NULL default 10;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_1` int(10) unsigned NOT NULL default 11;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_2` int(10) unsigned NOT NULL default 12;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_3` int(10) unsigned NOT NULL default 13;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_4` int(10) unsigned NOT NULL default 14;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_5` int(10) unsigned NOT NULL default 15;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_6` int(10) unsigned NOT NULL default 16;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_7` int(10) unsigned NOT NULL default 17;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_8` int(10) unsigned NOT NULL default 18;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_9` int(10) unsigned NOT NULL default 19;
|
||||
ALTER TABLE `talert_snmp` ADD COLUMN `order_10` int(10) unsigned NOT NULL default 20;
|
||||
|
|
|
@ -74,3 +74,27 @@ ALTER TABLE tnetwork_map ADD (l2_network NUMBER(1, 0) default 0 NOT NULL);
|
|||
-- Table `tlayout_data`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `tlayout_data` ADD COLUMN id_group NUMBER(10, 0) default 0 NOT NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `talert_snmp`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE talert_snmp ADD (order_1 NUMBER(10, 0) default 1 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_2 NUMBER(10, 0) default 2 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_3 NUMBER(10, 0) default 3 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_4 NUMBER(10, 0) default 4 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_5 NUMBER(10, 0) default 5 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_6 NUMBER(10, 0) default 6 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_7 NUMBER(10, 0) default 7 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_8 NUMBER(10, 0) default 8 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_9 NUMBER(10, 0) default 9 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_10 NUMBER(10, 0) default 10 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_11 NUMBER(10, 0) default 11 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_12 NUMBER(10, 0) default 12 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_13 NUMBER(10, 0) default 13 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_14 NUMBER(10, 0) default 14 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_15 NUMBER(10, 0) default 15 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_16 NUMBER(10, 0) default 16 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_17 NUMBER(10, 0) default 17 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_18 NUMBER(10, 0) default 18 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_19 NUMBER(10, 0) default 19 NOT NULL);
|
||||
ALTER TABLE talert_snmp ADD (order_20 NUMBER(10, 0) default 20 NOT NULL);
|
||||
|
|
|
@ -98,6 +98,27 @@ if ($save_alert || $modify_alert) {
|
|||
$custom_oid_data_18 = (string) get_parameter ("custom_oid_data_18");
|
||||
$custom_oid_data_19 = (string) get_parameter ("custom_oid_data_19");
|
||||
$custom_oid_data_20 = (string) get_parameter ("custom_oid_data_20");
|
||||
$order_1 = (int) get_parameter ("order_1", 1);
|
||||
$order_2 = (int) get_parameter ("order_2", 2);
|
||||
$order_3 = (int) get_parameter ("order_3", 3);
|
||||
$order_4 = (int) get_parameter ("order_4", 4);
|
||||
$order_5 = (int) get_parameter ("order_5", 5);
|
||||
$order_6 = (int) get_parameter ("order_6", 6);
|
||||
$order_7 = (int) get_parameter ("order_7", 7);
|
||||
$order_8 = (int) get_parameter ("order_8", 8);
|
||||
$order_9 = (int) get_parameter ("order_9", 9);
|
||||
$order_10 = (int) get_parameter ("order_10", 10);
|
||||
$order_11 = (int) get_parameter ("order_11", 11);
|
||||
$order_12 = (int) get_parameter ("order_12", 12);
|
||||
$order_13 = (int) get_parameter ("order_13", 13);
|
||||
$order_14 = (int) get_parameter ("order_14", 14);
|
||||
$order_15 = (int) get_parameter ("order_15", 15);
|
||||
$order_16 = (int) get_parameter ("order_16", 16);
|
||||
$order_17 = (int) get_parameter ("order_17", 17);
|
||||
$order_18 = (int) get_parameter ("order_18", 18);
|
||||
$order_19 = (int) get_parameter ("order_19", 19);
|
||||
$order_20 = (int) get_parameter ("order_20", 20);
|
||||
|
||||
$trap_type = (int) get_parameter ("trap_type", -1);
|
||||
$single_value = (string) get_parameter ("single_value");
|
||||
$position = (int) get_parameter ("position");
|
||||
|
@ -148,6 +169,26 @@ if ($save_alert || $modify_alert) {
|
|||
'_snmp_f18_' => $custom_oid_data_18,
|
||||
'_snmp_f19_' => $custom_oid_data_19,
|
||||
'_snmp_f20_' => $custom_oid_data_20,
|
||||
'order_1' => $order_1,
|
||||
'order_2' => $order_2,
|
||||
'order_3' => $order_3,
|
||||
'order_4' => $order_4,
|
||||
'order_5' => $order_5,
|
||||
'order_6' => $order_6,
|
||||
'order_7' => $order_7,
|
||||
'order_8' => $order_8,
|
||||
'order_9' => $order_9,
|
||||
'order_10' => $order_10,
|
||||
'order_11' => $order_11,
|
||||
'order_12' => $order_12,
|
||||
'order_13' => $order_13,
|
||||
'order_14' => $order_14,
|
||||
'order_15' => $order_15,
|
||||
'order_16' => $order_16,
|
||||
'order_17' => $order_17,
|
||||
'order_18' => $order_18,
|
||||
'order_19' => $order_19,
|
||||
'order_20' => $order_20,
|
||||
'trap_type' => $trap_type,
|
||||
'single_value' => $single_value,
|
||||
'position' => $position,
|
||||
|
@ -180,7 +221,14 @@ if ($save_alert || $modify_alert) {
|
|||
_snmp_f10_ = '%s', _snmp_f11_ = '%s', _snmp_f12_ = '%s',
|
||||
_snmp_f13_ = '%s', _snmp_f14_ = '%s', _snmp_f15_ = '%s',
|
||||
_snmp_f16_ = '%s', _snmp_f17_ = '%s', _snmp_f18_ = '%s',
|
||||
_snmp_f19_ = '%s', _snmp_f20_ = '%s', trap_type = %d,
|
||||
_snmp_f19_ = '%s', _snmp_f20_ = '%s', order_1 = '%d',
|
||||
order_2 = '%d', order_3 = '%d', order_4 = '%d',
|
||||
order_5 = '%d', order_6 = '%d', order_7 = '%d',
|
||||
order_8 = '%d', order_9 = '%d', order_10 = '%d',
|
||||
order_11 = '%d', order_12 = '%d', order_13 = '%d',
|
||||
order_14 = '%d', order_15 = '%d', order_16 = '%d',
|
||||
order_17 = '%d', order_18 = '%d', order_19 = '%d',
|
||||
order_20 = '%d', trap_type = %d,
|
||||
single_value = '%s', position = '%s', id_group ='%s'
|
||||
WHERE id_as = %d",
|
||||
$priority, $alert_type, $al_field1, $al_field2, $al_field3,
|
||||
|
@ -194,6 +242,10 @@ if ($save_alert || $modify_alert) {
|
|||
$custom_oid_data_12, $custom_oid_data_13, $custom_oid_data_14,
|
||||
$custom_oid_data_15, $custom_oid_data_16, $custom_oid_data_17,
|
||||
$custom_oid_data_18, $custom_oid_data_19, $custom_oid_data_20,
|
||||
$order_1, $order_2, $order_3, $order_4, $order_5,
|
||||
$order_6, $order_7, $order_8, $order_9, $order_10,
|
||||
$order_11, $order_12, $order_13, $order_14, $order_15,
|
||||
$order_16, $order_17, $order_18, $order_19, $order_20,
|
||||
$trap_type, $single_value, $position, $group, $id_as);
|
||||
|
||||
$result = db_process_sql ($sql);
|
||||
|
@ -255,6 +307,26 @@ if ($update_alert) {
|
|||
$custom_oid_data_18 = $alert["_snmp_f18_"];
|
||||
$custom_oid_data_19 = $alert["_snmp_f19_"];
|
||||
$custom_oid_data_20 = $alert["_snmp_f20_"];
|
||||
$order_1 = $alert["order_1"];
|
||||
$order_2 = $alert["order_2"];
|
||||
$order_3 = $alert["order_3"];
|
||||
$order_4 = $alert["order_4"];
|
||||
$order_5 = $alert["order_5"];
|
||||
$order_6 = $alert["order_6"];
|
||||
$order_7 = $alert["order_7"];
|
||||
$order_8 = $alert["order_8"];
|
||||
$order_9 = $alert["order_9"];
|
||||
$order_10 = $alert["order_10"];
|
||||
$order_11 = $alert["order_11"];
|
||||
$order_12 = $alert["order_12"];
|
||||
$order_13 = $alert["order_13"];
|
||||
$order_14 = $alert["order_14"];
|
||||
$order_15 = $alert["order_15"];
|
||||
$order_16 = $alert["order_16"];
|
||||
$order_17 = $alert["order_17"];
|
||||
$order_18 = $alert["order_18"];
|
||||
$order_19 = $alert["order_19"];
|
||||
$order_20 = $alert["order_20"];
|
||||
$trap_type = $alert["trap_type"];
|
||||
$single_value = $alert["single_value"];
|
||||
$position = $alert["position"];
|
||||
|
@ -302,6 +374,26 @@ elseif ($create_alert) {
|
|||
$custom_oid_data_18 = '';
|
||||
$custom_oid_data_19 = '';
|
||||
$custom_oid_data_20 = '';
|
||||
$order_1 = 1;
|
||||
$order_2 = 2;
|
||||
$order_3 = 3;
|
||||
$order_4 = 4;
|
||||
$order_5 = 5;
|
||||
$order_6 = 6;
|
||||
$order_7 = 7;
|
||||
$order_8 = 8;
|
||||
$order_9 = 9;
|
||||
$order_10 = 10;
|
||||
$order_11 = 11;
|
||||
$order_12 = 12;
|
||||
$order_13 = 13;
|
||||
$order_14 = 14;
|
||||
$order_15 = 15;
|
||||
$order_16 = 16;
|
||||
$order_17 = 17;
|
||||
$order_18 = 18;
|
||||
$order_19 = 19;
|
||||
$order_20 = 20;
|
||||
$trap_type = -1;
|
||||
$single_value = '';
|
||||
$position = 0;
|
||||
|
@ -430,134 +522,174 @@ if ($create_alert || $update_alert) {
|
|||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #1
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #1');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo ui_print_help_icon ("field_match_snmp", true);
|
||||
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_1", $order_1, '', 4);
|
||||
html_print_input_text ("custom_oid_data_1", $custom_oid_data_1, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #2
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #2');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
//echo ui_print_help_icon ("snmp_alert_custom", true);
|
||||
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_2", $order_2, '', 4);
|
||||
html_print_input_text ("custom_oid_data_2", $custom_oid_data_2, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #3
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #3');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
//echo ui_print_help_icon ("snmp_alert_custom", true);
|
||||
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_3", $order_3, '', 4);
|
||||
html_print_input_text ("custom_oid_data_3", $custom_oid_data_3, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #4
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #4');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
//echo ui_print_help_icon ("snmp_alert_custom", true);
|
||||
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_4", $order_4, '', 4);
|
||||
html_print_input_text ("custom_oid_data_4", $custom_oid_data_4, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #5
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #5');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
//echo ui_print_help_icon ("snmp_alert_custom", true);
|
||||
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_5", $order_5, '', 4);
|
||||
html_print_input_text ("custom_oid_data_5", $custom_oid_data_5, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #6
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #6');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
//echo ui_print_help_icon ("snmp_alert_custom", true);
|
||||
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_6", $order_6, '', 4);
|
||||
html_print_input_text ("custom_oid_data_6", $custom_oid_data_6, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #7
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #7');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_7", $order_7, '', 4);
|
||||
html_print_input_text ("custom_oid_data_7", $custom_oid_data_7, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #8
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #8');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_8", $order_8, '', 4);
|
||||
html_print_input_text ("custom_oid_data_8", $custom_oid_data_8, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #9
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #9');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_9", $order_9, '', 4);
|
||||
html_print_input_text ("custom_oid_data_9", $custom_oid_data_9, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #10
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #10');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_10", $order_10, '', 4);
|
||||
html_print_input_text ("custom_oid_data_10", $custom_oid_data_10, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #11
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #11');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_11", $order_11, '', 4);
|
||||
html_print_input_text ("custom_oid_data_11", $custom_oid_data_11, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #12
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #12');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_12", $order_12, '', 4);
|
||||
html_print_input_text ("custom_oid_data_12", $custom_oid_data_12, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #13
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #13');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_13", $order_13, '', 4);
|
||||
html_print_input_text ("custom_oid_data_13", $custom_oid_data_13, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #14
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #14');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_14", $order_14, '', 4);
|
||||
html_print_input_text ("custom_oid_data_14", $custom_oid_data_14, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #15
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #15');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_15", $order_15, '', 4);
|
||||
html_print_input_text ("custom_oid_data_15", $custom_oid_data_15, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #16
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #16');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_16", $order_16, '', 4);
|
||||
html_print_input_text ("custom_oid_data_16", $custom_oid_data_16, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #17
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #17');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_17", $order_17, '', 4);
|
||||
html_print_input_text ("custom_oid_data_17", $custom_oid_data_17, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #18
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #18');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_18", $order_18, '', 4);
|
||||
html_print_input_text ("custom_oid_data_18", $custom_oid_data_18, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #19
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #19');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_19", $order_19, '', 4);
|
||||
html_print_input_text ("custom_oid_data_19", $custom_oid_data_19, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Custom OID/Data #20
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data #20');
|
||||
echo '<tr id="tr-custom_value"><td class="datos" valign="top">'.__('Custom OID/Data');
|
||||
echo '</td><td class="datos">';
|
||||
echo '#';
|
||||
html_print_input_text ("order_20", $order_20, '', 4);
|
||||
html_print_input_text ("custom_oid_data_20", $custom_oid_data_20, '', 60);
|
||||
echo '</td></tr>';
|
||||
|
||||
|
@ -590,12 +722,22 @@ if ($create_alert || $update_alert) {
|
|||
// Hidden div with help hint to fill with javascript
|
||||
html_print_div(array('id' => 'help_snmp_alert_hint', 'content' => ui_print_help_icon ("snmp_alert_field1", true), 'hidden' => true));
|
||||
|
||||
/*
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
echo '<tr id="table_macros-field'.$i.'"><td class="datos" valign="top">'.html_print_image('images/spinner.gif',true);
|
||||
echo '<td class="datos">' . html_print_image('images/spinner.gif',true);
|
||||
html_print_input_hidden('field'.$i.'_value', isset($al['al_field'.$i]) ? $al['al_field'.$i] : '');
|
||||
echo '</td></tr>';
|
||||
}
|
||||
*/
|
||||
for ($i = 1; $i <= 10; $i++) {
|
||||
echo '<tr id="table_macros-field'.$i.'">';
|
||||
//echo '<td class="datos" valign="top">'.html_print_image('images/spinner.gif',true).'</td>';
|
||||
//echo '<td class="datos">' . html_print_image('images/spinner.gif',true).'</td>';
|
||||
//html_print_input_hidden('field'.$i.'_value', isset($al['al_field'.$i]) ? $al['al_field'.$i] : '');
|
||||
//echo '</td></tr>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
// Max / Min alerts
|
||||
echo '<tr><td class="datos2">' . __('Min. number of alerts').'</td><td class="datos2">';
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
|
@ -4,6 +4,37 @@
|
|||
*/
|
||||
?>
|
||||
|
||||
<h1>Custom OID/Data #1-10</h1>
|
||||
<h1>Custom OID/Data #1-20</h1>
|
||||
|
||||
<p>These are regular expressions that try to match binding variables 1 to 10. If there is a match, the alert is fired. The value of the variable is stored in the corresponding _snmp_fx_ macro (_snmp_f1_, _snmp_f2_, ...). Even though only the first ten binding variables can be searched for matches, _snmp_fx_ macros are set for all of them (_snmp_f11_, _snmp_f12_, ...).</p>
|
||||
<p>These are regular expressions that try to match binding variables 1 to 20. If there is a match, the alert is fired. The value of the variable is stored in the corresponding _snmp_fx_ macro (_snmp_f1_, _snmp_f2_, ...). Even though only twenty variables can be searched for matches, _snmp_fx_ macros are set for all of them (_snmp_f11_, _snmp_f12_, ...).</p>
|
||||
|
||||
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<p>You can use up to 20 variables for doing the filtering (and reusing later for macros). But they doesnt need to follow a specific order. The position of the variable can be defined in the field preceding value.
|
||||
That is, if we want to make an alert seeking values "Uno" in the first variable received at the trap, "Tres" in the third variable received by the trap and the same for “Cinco” and “Siete”, is configured as you can see below:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<img src="../images/help/custom_oid.png" width='520' height='180'>
|
||||
</tr>
|
||||
<tr>
|
||||
<p>We can use the value of the variables in macros _snmp_f1_ coincidence .. so _snmp_f7_ to define the alert, the alert action allows us to use these macros:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<img src="../images/help/custom_oid2.png" width='520' height='60'>
|
||||
</tr>
|
||||
<tr>
|
||||
<p>Here's an example of SNMP trap that will trigger the alert:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<img src="../images/help/trap.png" width='520' height='220'>
|
||||
</tr>
|
||||
<tr>
|
||||
<p>Alert generated (an internal audit) will have this text:
|
||||
|
||||
SNMP Alert of 192.168.5.2 with OID .1.3.6.1.4.1.2789.2005
|
||||
Binding 1: “uno” Binding 3: “tres” Binding 5: “cinco” Binding 7: “siete”
|
||||
|
||||
Thus, if the trap has 200 variables, you can use up to 20 filters variables (bindings) and take the value of up to 20 variables, regardless if they are in the 10, 50, or 170 position.</p>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -4,6 +4,35 @@
|
|||
*/
|
||||
?>
|
||||
|
||||
<h1>Custom OID/Data #1-10</h1>
|
||||
<h1>Custom OID/Data #1-20</h1>
|
||||
|
||||
<p>Son expresiones regulares que intentan casar con las variables 1 a 10. Si hay un acierto, se dispara la alerta. El valor de la variable se guarda en la macro _snmp_fx_ correspondiente (_snmp_f1_, _snmp_f2_, ...). Aunque sólo se puede especificar una expresión regular para las diez primeras variables, las macros _snmp_fx_ macros están disponibles para todas ellas (_snmp_f11_, _snmp_f12_, ...).</p>
|
||||
<p>Son expresiones regulares que intentan casar con las variables 1 a 20. Si hay un acierto, se dispara la alerta. El valor de la variable se guarda en la macro _snmp_fx_ correspondiente (_snmp_f1_, _snmp_f2_, ...). Aunque sólo se puede especificar una expresión regular para veinte variables, las macros _snmp_fx_ macros están disponibles para todas ellas (_snmp_f11_, _snmp_f12_, ...).</p>
|
||||
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<p>Como hemos visto, se pueden almacenar hasta 20 variables. Estas variables no tienen por qué seguir un órden consecutivo. La posición que ocupa la variable se puede definir en el campo que precede su valor. Es decir, si nosotros queremos hacer una alerta que busque los valores “Uno” en la primera variable recibida en el trap, “tres” en la tercera variable recibida por el trap y lo mismo para Cinco y Siete, se configuraría como se puede ver más abajo:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<img src="../images/help/custom_oid.png" width='520' height='180'>
|
||||
</tr>
|
||||
<tr>
|
||||
<p>Podemos hacer uso del valor de las variables con coincidencia en las macros _snmp_f1_ .. _snmp_f7_ de forma que al definir la alerta, la acción nos permite usar esas macros:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<img src="../images/help/custom_oid2.png" width='520' height='180'>
|
||||
</tr>
|
||||
<tr>
|
||||
<p>Aquí tenemos un ejemplo de trap con que el se disparará la alerta:</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<img src="../images/help/trap.png" width='520' height='220'>
|
||||
</tr>
|
||||
<tr>
|
||||
<p>La alerta generada, un evento de auditoria tiene este texto:
|
||||
|
||||
SNMP Alert of 192.168.5.2 with OID .1.3.6.1.4.1.2789.2005
|
||||
Binding 1: “uno” Binding 3: “tres” Binding 5: “cinco” Binding 7: “siete”
|
||||
|
||||
De esta manera, si el trap tiene 200 variables, se pueden usar hasta 20 filtros de variables (bindings) y tomar el valor de hasta 20 variables, independientemente si están en la posición 10, 50, o 170.</p>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -31,12 +31,9 @@ if (! check_acl ($config['id_user'], 0, "AR")) {
|
|||
}
|
||||
|
||||
// Read parameters
|
||||
$filter_agent = (string) get_parameter ("filter_agent", '');
|
||||
$filter_oid = (string) get_parameter ("filter_oid", '');
|
||||
$filter_severity = (int) get_parameter ("filter_severity", -1);
|
||||
$filter_fired = (int) get_parameter ("filter_fired", -1);
|
||||
$filter_status = (int) get_parameter ("filter_status", 0);
|
||||
$search_string = (string) get_parameter ("search_string", '');
|
||||
$free_search_string = (string) get_parameter ("free_search_string", '');
|
||||
$pagination = (int) get_parameter ("pagination", $config["block_size"]);
|
||||
$offset = (int) get_parameter ('offset',0);
|
||||
|
@ -58,11 +55,8 @@ foreach ($user_groups as $id=>$name) {
|
|||
|
||||
$url = "index.php?sec=estado&" .
|
||||
"sec2=operation/snmpconsole/snmp_view&" .
|
||||
"filter_agent=" . $filter_agent . "&" .
|
||||
"filter_oid=" . $filter_oid . "&" .
|
||||
"filter_severity=" . $filter_severity . "&" .
|
||||
"filter_fired=" . $filter_fired . "&" .
|
||||
"search_string=" . $search_string . "&" .
|
||||
"free_search_string=" . $free_search_string . "&" .
|
||||
"pagination=" . $pagination . "&" .
|
||||
"offset=" . $offset . "&" .
|
||||
|
@ -148,69 +142,6 @@ if (isset ($_POST["updatebt"])) {
|
|||
}
|
||||
}
|
||||
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$sql = sprintf ("
|
||||
SELECT *
|
||||
FROM ttrap
|
||||
WHERE `source` IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
)
|
||||
OR `source`=''
|
||||
ORDER BY timestamp DESC
|
||||
LIMIT %d,%d",$offset,$pagination);
|
||||
break;
|
||||
case "postgresql":
|
||||
$sql = sprintf ("
|
||||
SELECT *
|
||||
FROM ttrap
|
||||
WHERE `source` IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
)
|
||||
OR `source`=''
|
||||
ORDER BY timestamp DESC
|
||||
LIMIT %d OFFSET %d",$pagination, $offset);
|
||||
break;
|
||||
case "oracle":
|
||||
$set = array();
|
||||
$set['limit'] = $pagination;
|
||||
$set['offset'] = $offset;
|
||||
$sql = sprintf ("
|
||||
SELECT *
|
||||
FROM ttrap
|
||||
WHERE `source` IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
)
|
||||
OR `source`=''
|
||||
ORDER BY timestamp DESC");
|
||||
$sql = oracle_recode_query ($sql, $set);
|
||||
break;
|
||||
}
|
||||
|
||||
$traps = db_get_all_rows_sql ($sql);
|
||||
// All traps
|
||||
$all_traps = db_get_all_rows_sql ("SELECT DISTINCT source FROM ttrap
|
||||
WHERE `source` IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
)
|
||||
OR `source`=''");
|
||||
|
||||
if (($config['dbtype'] == 'oracle') && ($traps !== false)) {
|
||||
for ($i=0; $i < count($traps); $i++) {
|
||||
unset($traps[$i]['rnum']);
|
||||
}
|
||||
}
|
||||
|
||||
// No traps
|
||||
if (empty ($traps)) {
|
||||
echo '<div class="nf">'.__('There are no SNMP traps in database').'</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
$table->width = '90%';
|
||||
$table->size = array ();
|
||||
$table->size[0] = '120px';
|
||||
|
@ -236,33 +167,31 @@ switch ($config["dbtype"]) {
|
|||
case "mysql":
|
||||
$sql = "SELECT *
|
||||
FROM ttrap
|
||||
WHERE `source` IN (
|
||||
WHERE (`source` IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
)
|
||||
OR `source`='' %s
|
||||
) OR `source`='') %s
|
||||
ORDER BY timestamp DESC
|
||||
LIMIT %d,%d";
|
||||
break;
|
||||
case "postgresql":
|
||||
$sql = "SELECT *
|
||||
FROM ttrap
|
||||
WHERE source IN (
|
||||
WHERE (source IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
)
|
||||
OR source='' %s
|
||||
) OR source='') %s
|
||||
ORDER BY timestamp DESC
|
||||
LIMIT %d OFFSET %d";
|
||||
break;
|
||||
case "oracle":
|
||||
$sql = "SELECT *
|
||||
FROM ttrap
|
||||
WHERE source IN (
|
||||
WHERE (source IN (
|
||||
SELECT direccion FROM tagente
|
||||
WHERE id_grupo IN ($str_user_groups)
|
||||
)
|
||||
OR source='' %s
|
||||
OR source='') %s
|
||||
ORDER BY timestamp DESC
|
||||
LIMIT %d OFFSET %d";
|
||||
break;
|
||||
|
@ -270,56 +199,9 @@ switch ($config["dbtype"]) {
|
|||
//$whereSubquery = 'WHERE 1=1';
|
||||
$whereSubquery = '';
|
||||
|
||||
if ($filter_agent != '') {
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$whereSubquery .= ' AND source LIKE "' . $filter_agent . '"';
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
$whereSubquery .= ' AND source LIKE \'' . $filter_agent . '\'';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filter_oid != '') {
|
||||
//Test if install the enterprise to search oid in text or oid field in ttrap.
|
||||
if ($config['enterprise_installed']) {
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$whereSubquery .= ' AND (text LIKE "' . $filter_oid . '" OR oid LIKE "' . $filter_oid . '")';
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
$whereSubquery .= ' AND (text LIKE \'' . $filter_oid . '\' OR oid LIKE \'' . $filter_oid . '\')';
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$whereSubquery .= ' AND oid LIKE "' . $filter_oid . '"';
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
$whereSubquery .= ' AND oid LIKE \'' . $filter_oid . '\'';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($filter_fired != -1)
|
||||
$whereSubquery .= ' AND alerted = ' . $filter_fired;
|
||||
if ($search_string != '') {
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
$whereSubquery .= ' AND value LIKE "%' . $search_string . '%"';
|
||||
break;
|
||||
case "postgresql":
|
||||
case "oracle":
|
||||
$whereSubquery .= ' AND value LIKE \'%' . $search_string . '%\'';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($free_search_string != '') {
|
||||
switch ($config["dbtype"]) {
|
||||
case "mysql":
|
||||
|
@ -392,28 +274,23 @@ switch ($config["dbtype"]) {
|
|||
|
||||
$traps = db_get_all_rows_sql($sql);
|
||||
|
||||
// No traps
|
||||
if (empty ($traps)) {
|
||||
echo '<div class="nf">'.__('There are no SNMP traps in database').'</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
if (($config['dbtype'] == 'oracle') && ($traps !== false)) {
|
||||
for ($i=0; $i < count($traps); $i++) {
|
||||
unset($traps[$i]['rnum']);
|
||||
}
|
||||
}
|
||||
|
||||
// Agent select
|
||||
$table->data[0][0] = '<strong>'.__('Agent').'</strong>';
|
||||
$table->data[0][1] = html_print_select ($agents, 'filter_agent', $filter_agent, 'javascript:this.form.submit();', __('All'), '', true);
|
||||
|
||||
// OID select
|
||||
$table->data[0][2] = '<strong>'.__('OID').'</strong>';
|
||||
$table->data[0][3] = html_print_select ($oids, 'filter_oid', $filter_oid, 'javascript:this.form.submit();', __('All'), '', true);
|
||||
|
||||
// Alert status select
|
||||
$table->data[1][0] = '<strong>'.__('Alert').'</strong>';
|
||||
$table->data[1][1] = html_print_select ($alerted, "filter_fired", $filter_fired, 'javascript:this.form.submit();', __('All'), '-1', true);
|
||||
|
||||
// String search_string
|
||||
$table->data[1][2] = '<strong>'.__('Search value').'</strong>';
|
||||
$table->data[1][3] = html_print_input_text ('search_string', $search_string, '', 40, 0, true);
|
||||
|
||||
// Block size for pagination select
|
||||
$table->data[2][0] = '<strong>'.__('Block size for pagination').'</strong>';
|
||||
$paginations[25] = 25;
|
||||
|
@ -424,8 +301,8 @@ $paginations[500] = 500;
|
|||
$table->data[2][1] = html_print_select ($paginations, "pagination", $pagination, 'this.form.submit();', __('Default'), $config["block_size"], true);
|
||||
|
||||
// Severity select
|
||||
$table->data[2][2] = '<strong>'.__('Severity').'</strong>';
|
||||
$table->data[2][3] = html_print_select ($severities, 'filter_severity', $filter_severity, 'this.form.submit();', __('All'), -1, true);
|
||||
$table->data[1][2] = '<strong>'.__('Severity').'</strong>';
|
||||
$table->data[1][3] = html_print_select ($severities, 'filter_severity', $filter_severity, 'this.form.submit();', __('All'), -1, true);
|
||||
|
||||
// Status
|
||||
$table->data[3][0] = '<strong>'.__('Status').'</strong>';
|
||||
|
@ -436,17 +313,17 @@ $status_array[1] = __('Validated');
|
|||
$table->data[3][1] = html_print_select ($status_array, 'filter_status', $filter_status, 'this.form.submit();', '', '', true);
|
||||
|
||||
// Free search (search by all alphanumeric fields)
|
||||
$table->data[3][3] = '<strong>'.__('Free search').'</strong>' . ui_print_help_tip(__('Search by any alphanumeric field in the trap'), true);
|
||||
$table->data[3][4] = html_print_input_text ('free_search_string', $free_search_string, '', 40, 0, true);
|
||||
$table->data[2][3] = '<strong>'.__('Free search').'</strong>' . ui_print_help_tip(__('Search by any alphanumeric field in the trap'), true);
|
||||
$table->data[2][4] = html_print_input_text ('free_search_string', $free_search_string, '', 40, 0, true);
|
||||
|
||||
// Type filter (ColdStart, WarmStart, LinkDown, LinkUp, authenticationFailure, Other)
|
||||
$table->data[4][1] = '<strong>'.__('Type').'</strong>' . ui_print_help_tip(__('Search by trap type'), true);
|
||||
$trap_types = array(-1 => __('None'), 0 => __('Cold start (0)'), 1 => __('Warm start (1)'), 2 => __('Link down (2)'), 3 => __('Link up (3)'), 4 => __('Authentication failure (4)'), 5 => __('Other'));
|
||||
$table->data[4][2] = html_print_select ($trap_types, 'trap_type', $trap_type, 'this.form.submit();', '', '', true, false, false);
|
||||
|
||||
$table->data[4][3] = '<strong>'.__('Group by OID/IP').'</strong>';
|
||||
$table->data[4][4] .= __('Yes').' '.html_print_radio_button ('group_by', 1, '', $group_by, true).' ';
|
||||
$table->data[4][4] .= __('No').' '.html_print_radio_button ('group_by', 0, '', $group_by, true);
|
||||
$table->data[3][3] = '<strong>'.__('Group by OID/IP').'</strong>';
|
||||
$table->data[3][4] .= __('Yes').' '.html_print_radio_button ('group_by', 1, '', $group_by, true).' ';
|
||||
$table->data[3][4] .= __('No').' '.html_print_radio_button ('group_by', 0, '', $group_by, true);
|
||||
|
||||
$filter = '<form method="POST" action="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&refr='.((int)get_parameter('refr', 0)).'&pure='.$config["pure"].'">';
|
||||
$filter .= html_print_table($table, true);
|
||||
|
@ -460,28 +337,18 @@ ui_toggle($filter, __('Toggle filter(s)'));
|
|||
unset ($table);
|
||||
|
||||
// Prepare index for pagination
|
||||
/*
|
||||
$trapcount = db_get_sql ("
|
||||
SELECT COUNT(id_trap)
|
||||
FROM ttrap " .
|
||||
$whereSubquery);
|
||||
*/
|
||||
|
||||
$trapcount = count($traps);
|
||||
|
||||
$url_snmp = "index.php?" .
|
||||
"sec=snmpconsole&" .
|
||||
"sec2=operation/snmpconsole/snmp_view&" .
|
||||
"filter_agent=" . $filter_agent . "&" .
|
||||
"filter_oid=" . $filter_oid . "&" .
|
||||
"filter_severity=" . $filter_severity . "&" .
|
||||
"filter_fired=" . $filter_fired . "&" .
|
||||
"filter_status=" . $filter_status . "&" .
|
||||
"search_string=" . $search_string . "&" .
|
||||
"refr=" . ((int)get_parameter('refr', 0)) . "&" .
|
||||
"pure=" . $config["pure"] . "&" .
|
||||
"group_by=" . $group_by . "&" .
|
||||
"search_string=" . $search_string;
|
||||
"free_search_string=" . $free_search_string;
|
||||
|
||||
$urlPagination = $url_snmp . "&pagination=" . $pagination . "&offset=" . $offset;
|
||||
|
||||
|
@ -510,31 +377,37 @@ $table->head[2] = __('OID');
|
|||
$table->align[2] = "center";
|
||||
$table->size[2] = '18%';
|
||||
|
||||
$table->head[3] = __('Value');
|
||||
$table->align[3] = "center";
|
||||
$table->size[3] = '10%';
|
||||
if ($group_by) {
|
||||
$table->head[3] = __('Count');
|
||||
$table->align[3] = "center";
|
||||
$table->size[3] = '5%';
|
||||
}
|
||||
|
||||
$table->head[4] = __('User ID');
|
||||
$table->head[4] = __('Value');
|
||||
$table->align[4] = "center";
|
||||
$table->size[4] = '10%';
|
||||
|
||||
$table->head[5] = __('Timestamp');
|
||||
$table->head[5] = __('User ID');
|
||||
$table->align[5] = "center";
|
||||
$table->size[5] = '10%';
|
||||
|
||||
$table->head[6] = __('Alert');
|
||||
$table->head[6] = __('Timestamp');
|
||||
$table->align[6] = "center";
|
||||
$table->size[6] = '5%';
|
||||
$table->size[6] = '10%';
|
||||
|
||||
$table->head[7] = __('Action');
|
||||
$table->head[7] = __('Alert');
|
||||
$table->align[7] = "center";
|
||||
$table->size[7] = '10%';
|
||||
$table->size[7] = '5%';
|
||||
|
||||
$table->head[8] = html_print_checkbox_extended ("allbox", 1, false, false, "javascript:CheckAll();", 'class="chk" title="'.__('All').'"', true);
|
||||
$table->head[8] = __('Action');
|
||||
$table->align[8] = "center";
|
||||
$table->size[8] = '5%';
|
||||
$table->size[8] = '10%';
|
||||
|
||||
$table->style[7] = "background: #F3F3F3; color: #111 !important;";
|
||||
$table->head[9] = html_print_checkbox_extended ("allbox", 1, false, false, "javascript:CheckAll();", 'class="chk" title="'.__('All').'"', true);
|
||||
$table->align[9] = "center";
|
||||
$table->size[9] = '5%';
|
||||
|
||||
$table->style[8] = "background: #F3F3F3; color: #111 !important;";
|
||||
|
||||
// Skip offset records
|
||||
$idx = 0;
|
||||
|
@ -579,63 +452,74 @@ if ($traps !== false) {
|
|||
$table->cellclass[$idx][2] = get_priority_class ($severity);
|
||||
$data[2] = '<a href="javascript: toggleVisibleExtendedInfo(' . $trap["id_trap"] . ');">' . (empty($trap["oid"]) ? __('N/A') : $trap["oid"]) .'</a>';
|
||||
|
||||
//Count
|
||||
if ($group_by) {
|
||||
$sql = "SELECT * FROM ttrap WHERE 1=1
|
||||
$where_without_group
|
||||
AND oid='".$trap['oid']."'
|
||||
AND source='".$trap['source']."'";
|
||||
$group_traps = db_get_all_rows_sql($sql);
|
||||
$count_group_traps = count($group_traps);
|
||||
$table->cellclass[$idx][3] = get_priority_class ($severity);
|
||||
$data[3] = '<strong>'.$count_group_traps.'</strong></a>';
|
||||
}
|
||||
//Value
|
||||
$table->cellclass[$idx][3] = get_priority_class ($severity);
|
||||
$table->cellclass[$idx][4] = get_priority_class ($severity);
|
||||
if (empty ($trap["value"])) {
|
||||
$data[3] = __('N/A');
|
||||
$data[4] = __('N/A');
|
||||
}
|
||||
else {
|
||||
$data[3] = ui_print_truncate_text($trap["value"], GENERIC_SIZE_TEXT, false);
|
||||
$data[4] = ui_print_truncate_text($trap["value"], GENERIC_SIZE_TEXT, false);
|
||||
}
|
||||
|
||||
//User
|
||||
$table->cellclass[$idx][4] = get_priority_class ($severity);
|
||||
$table->cellclass[$idx][5] = get_priority_class ($severity);
|
||||
if (!empty ($trap["status"])) {
|
||||
$data[4] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit&ver='.$trap["id_usuario"].'">'.substr ($trap["id_usuario"], 0, 8).'</a>';
|
||||
$data[5] = '<a href="index.php?sec=workspace&sec2=operation/users/user_edit&ver='.$trap["id_usuario"].'">'.substr ($trap["id_usuario"], 0, 8).'</a>';
|
||||
if (!empty($trap["id_usuario"]))
|
||||
$data[4] .= ui_print_help_tip(get_user_fullname($trap["id_usuario"]), true);
|
||||
$data[5] .= ui_print_help_tip(get_user_fullname($trap["id_usuario"]), true);
|
||||
}
|
||||
else {
|
||||
$data[4] = '--';
|
||||
$data[5] = '--';
|
||||
}
|
||||
|
||||
// Timestamp
|
||||
$table->cellclass[$idx][5] = get_priority_class ($severity);
|
||||
$data[5] = '<span title="'.$trap["timestamp"].'">';
|
||||
$data[5] .= ui_print_timestamp ($trap["timestamp"], true);
|
||||
$data[5] .= '</span>';
|
||||
$table->cellclass[$idx][6] = get_priority_class ($severity);
|
||||
$data[6] = '<span title="'.$trap["timestamp"].'">';
|
||||
$data[6] .= ui_print_timestamp ($trap["timestamp"], true);
|
||||
$data[6] .= '</span>';
|
||||
|
||||
// Use alert severity if fired
|
||||
if (!empty ($trap["alerted"])) {
|
||||
$data[6] = html_print_image("images/pixel_yellow.png", true, array("width" => "20", "height" => "20", "border" => "0", "title" => __('Alert fired')));
|
||||
$data[7] = html_print_image("images/pixel_yellow.png", true, array("width" => "20", "height" => "20", "border" => "0", "title" => __('Alert fired')));
|
||||
}
|
||||
else {
|
||||
$data[6] = html_print_image("images/pixel_gray.png", true, array("width" => "20", "height" => "20", "border" => "0", "title" => __('Alert not fired')));
|
||||
$data[7] = html_print_image("images/pixel_gray.png", true, array("width" => "20", "height" => "20", "border" => "0", "title" => __('Alert not fired')));
|
||||
}
|
||||
|
||||
//Actions
|
||||
$data[7] = "";
|
||||
$data[8] = "";
|
||||
|
||||
if (empty ($trap["status"]) && check_acl ($config["id_user"], 0, "IW")) {
|
||||
$data[7] .= '<a href="' . $url_snmp . '&check='.$trap["id_trap"].'">' . html_print_image("images/ok.png", true, array("border" => '0', "title" => __('Validate'))) . '</a> ';
|
||||
$data[8] .= '<a href="' . $url_snmp . '&check='.$trap["id_trap"].'">' . html_print_image("images/ok.png", true, array("border" => '0', "title" => __('Validate'))) . '</a> ';
|
||||
}
|
||||
if ($trap['source'] == '') {
|
||||
$is_admin = db_get_value('is_admin', 'tusuario', 'id_user',$config['id_user']);
|
||||
if ($is_admin) {
|
||||
$data[7] .= '<a href="' . $url_snmp . '&delete='.$trap["id_trap"].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">' . html_print_image("images/cross.png", true, array("border" => "0", "title" => __('Delete'))) . '</a> ';
|
||||
$data[8] .= '<a href="' . $url_snmp . '&delete='.$trap["id_trap"].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">' . html_print_image("images/cross.png", true, array("border" => "0", "title" => __('Delete'))) . '</a> ';
|
||||
}
|
||||
} else {
|
||||
$agent_trap_group = db_get_value('id_grupo', 'tagente', 'nombre', $trap['source']);
|
||||
if ((check_acl ($config["id_user"], $agent_trap_group, "AW"))) {
|
||||
$data[7] .= '<a href="' . $url_snmp . '&delete='.$trap["id_trap"].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">' . html_print_image("images/cross.png", true, array("border" => "0", "title" => __('Delete'))) . '</a> ';
|
||||
$data[8] .= '<a href="' . $url_snmp . '&delete='.$trap["id_trap"].'&offset='.$offset.'" onClick="javascript:return confirm(\''.__('Are you sure?').'\')">' . html_print_image("images/cross.png", true, array("border" => "0", "title" => __('Delete'))) . '</a> ';
|
||||
}
|
||||
}
|
||||
|
||||
$data[7] .= '<a href="javascript: toggleVisibleExtendedInfo(' . $trap["id_trap"] . ');">' . html_print_image("images/eye.png", true, array("alt" => __('Show more'), "title" => __('Show more'))) .'</a>';
|
||||
$data[7] .= enterprise_hook ('editor_link', array ($trap));
|
||||
$data[8] .= '<a href="javascript: toggleVisibleExtendedInfo(' . $trap["id_trap"] . ');">' . html_print_image("images/eye.png", true, array("alt" => __('Show more'), "title" => __('Show more'))) .'</a>';
|
||||
$data[8] .= enterprise_hook ('editor_link', array ($trap));
|
||||
|
||||
|
||||
$data[8] = html_print_checkbox_extended ("snmptrapid[]", $trap["id_trap"], false, false, '', 'class="chk"', true);
|
||||
$data[9] = html_print_checkbox_extended ("snmptrapid[]", $trap["id_trap"], false, false, '', 'class="chk"', true);
|
||||
|
||||
array_push ($table->data, $data);
|
||||
|
||||
|
@ -644,11 +528,24 @@ if ($traps !== false) {
|
|||
<tr>
|
||||
<td align="left" valign="top" width="15%" ><b>' . __('Custom data:') . '</b></td>
|
||||
<td align="left" >';
|
||||
|
||||
// Print binding vars separately
|
||||
$binding_vars = explode ("\t", $trap['oid_custom']);
|
||||
foreach ($binding_vars as $var) {
|
||||
$string .= $var . "<br/>";
|
||||
|
||||
if ($group_by) {
|
||||
$new_url = "index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&" .
|
||||
"filter_severity=" . $filter_severity . "&" .
|
||||
"filter_fired=" . $filter_fired . "&" .
|
||||
"filter_status=" . $filter_status . "&" .
|
||||
"refr=" . ((int)get_parameter('refr', 0)) . "&" .
|
||||
"pure=" . $config["pure"] . "&" .
|
||||
"group_by=0&" .
|
||||
"free_search_string=" . $free_search_string;
|
||||
|
||||
$string .= '<a href='.$new_url.'>'.__('See more details').'</a>';
|
||||
} else {
|
||||
// Print binding vars separately
|
||||
$binding_vars = explode ("\t", $trap['oid_custom']);
|
||||
foreach ($binding_vars as $var) {
|
||||
$string .= $var . "<br/>";
|
||||
}
|
||||
}
|
||||
|
||||
$string .= '</td>
|
||||
|
|
|
@ -317,7 +317,27 @@ CREATE TABLE talert_snmp (
|
|||
trap_type NUMBER(10, 0) DEFAULT -1 NOT NULL,
|
||||
single_value VARCHAR2(255) DEFAULT '',
|
||||
"position" NUMBER(10, 0) default 0 NOT NULL,
|
||||
id_group NUMBER(10, 0) default 0 NOT NULL
|
||||
id_group NUMBER(10, 0) default 0 NOT NULL,
|
||||
order_1 NUMBER(10, 0) default 1 NOT NULL ,
|
||||
order_2 NUMBER(10, 0) default 2 NOT NULL ,
|
||||
order_3 NUMBER(10, 0) default 3 NOT NULL ,
|
||||
order_4 NUMBER(10, 0) default 4 NOT NULL ,
|
||||
order_5 NUMBER(10, 0) default 5 NOT NULL ,
|
||||
order_6 NUMBER(10, 0) default 6 NOT NULL ,
|
||||
order_7 NUMBER(10, 0) default 7 NOT NULL ,
|
||||
order_8 NUMBER(10, 0) default 8 NOT NULL ,
|
||||
order_9 NUMBER(10, 0) default 9 NOT NULL ,
|
||||
order_10 NUMBER(10, 0) default 10 NOT NULL ,
|
||||
order_11 NUMBER(10, 0) default 11 NOT NULL ,
|
||||
order_12 NUMBER(10, 0) default 12 NOT NULL ,
|
||||
order_13 NUMBER(10, 0) default 13 NOT NULL ,
|
||||
order_14 NUMBER(10, 0) default 14 NOT NULL ,
|
||||
order_15 NUMBER(10, 0) default 15 NOT NULL ,
|
||||
order_16 NUMBER(10, 0) default 16 NOT NULL ,
|
||||
order_17 NUMBER(10, 0) default 17 NOT NULL ,
|
||||
order_18 NUMBER(10, 0) default 18 NOT NULL ,
|
||||
order_19 NUMBER(10, 0) default 19 NOT NULL ,
|
||||
order_20 NUMBER(10, 0) default 20 NOT NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE talert_snmp_s INCREMENT BY 1 START WITH 1;
|
||||
|
|
|
@ -300,7 +300,27 @@ CREATE TABLE "talert_snmp" (
|
|||
"trap_type" INTEGER NOT NULL DEFAULT '-1',
|
||||
"single_value" varchar(255) DEFAULT '',
|
||||
"position" INTEGER NOT NULL default 0,
|
||||
"id_group" INTEGER NOT NULL default 0
|
||||
"id_group" INTEGER NOT NULL default 0,
|
||||
"order_1" INTEGER NOT NULL default 1,
|
||||
"order_2" INTEGER NOT NULL default 2,
|
||||
"order_3" INTEGER NOT NULL default 3,
|
||||
"order_4" INTEGER NOT NULL default 4,
|
||||
"order_5" INTEGER NOT NULL default 5,
|
||||
"order_6" INTEGER NOT NULL default 6,
|
||||
"order_7" INTEGER NOT NULL default 7,
|
||||
"order_8" INTEGER NOT NULL default 8,
|
||||
"order_9" INTEGER NOT NULL default 9,
|
||||
"order_10" INTEGER NOT NULL default 10,
|
||||
"order_11" INTEGER NOT NULL default 11,
|
||||
"order_12" INTEGER NOT NULL default 12,
|
||||
"order_13" INTEGER NOT NULL default 13,
|
||||
"order_14" INTEGER NOT NULL default 14,
|
||||
"order_15" INTEGER NOT NULL default 15,
|
||||
"order_16" INTEGER NOT NULL default 16,
|
||||
"order_17" INTEGER NOT NULL default 17,
|
||||
"order_18" INTEGER NOT NULL default 18,
|
||||
"order_19" INTEGER NOT NULL default 19,
|
||||
"order_20" INTEGER NOT NULL default 20,
|
||||
);
|
||||
|
||||
CREATE TABLE "talert_commands" (
|
||||
|
|
|
@ -307,6 +307,26 @@ CREATE TABLE IF NOT EXISTS `talert_snmp` (
|
|||
`single_value` varchar(255) default '',
|
||||
`position` int(10) unsigned NOT NULL default '0',
|
||||
`id_group` int(10) unsigned NOT NULL default '0',
|
||||
`order_1` int(10) unsigned NOT NULL default 1,
|
||||
`order_2` int(10) unsigned NOT NULL default 2,
|
||||
`order_3` int(10) unsigned NOT NULL default 3,
|
||||
`order_4` int(10) unsigned NOT NULL default 4,
|
||||
`order_5` int(10) unsigned NOT NULL default 5,
|
||||
`order_6` int(10) unsigned NOT NULL default 6,
|
||||
`order_7` int(10) unsigned NOT NULL default 7,
|
||||
`order_8` int(10) unsigned NOT NULL default 8,
|
||||
`order_9` int(10) unsigned NOT NULL default 9,
|
||||
`order_10` int(10) unsigned NOT NULL default 10,
|
||||
`order_11` int(10) unsigned NOT NULL default 11,
|
||||
`order_12` int(10) unsigned NOT NULL default 12,
|
||||
`order_13` int(10) unsigned NOT NULL default 13,
|
||||
`order_14` int(10) unsigned NOT NULL default 14,
|
||||
`order_15` int(10) unsigned NOT NULL default 15,
|
||||
`order_16` int(10) unsigned NOT NULL default 16,
|
||||
`order_17` int(10) unsigned NOT NULL default 17,
|
||||
`order_18` int(10) unsigned NOT NULL default 18,
|
||||
`order_19` int(10) unsigned NOT NULL default 19,
|
||||
`order_20` int(10) unsigned NOT NULL default 20,
|
||||
PRIMARY KEY (`id_as`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
Loading…
Reference in New Issue