diff --git a/pandora_console/extras/mr/43.sql b/pandora_console/extras/mr/43.sql new file mode 100644 index 0000000000..656679ebd0 --- /dev/null +++ b/pandora_console/extras/mr/43.sql @@ -0,0 +1,9 @@ +START TRANSACTION; + +ALTER TABLE `talert_snmp` ADD COLUMN `al_field16` TEXT NOT NULL AFTER `al_field15`; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field17` TEXT NOT NULL AFTER `al_field16`; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field18` TEXT NOT NULL AFTER `al_field17`; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field19` TEXT NOT NULL AFTER `al_field18`; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field20` TEXT NOT NULL AFTER `al_field19`; + +COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index b1e8f60aad..bc252093fd 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1256,11 +1256,16 @@ ALTER TABLE `talert_templates` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; -- --------------------------------------------------------------------- -- Table `talert_snmp` -- --------------------------------------------------------------------- -ALTER TABLE talert_snmp ADD COLUMN `al_field11` TEXT NOT NULL DEFAULT ""; -ALTER TABLE talert_snmp ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT ""; -ALTER TABLE talert_snmp ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT ""; -ALTER TABLE talert_snmp ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT ""; -ALTER TABLE talert_snmp ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field11` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field16` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field17` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field18` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field19` TEXT NOT NULL DEFAULT ""; +ALTER TABLE `talert_snmp` ADD COLUMN `al_field20` TEXT NOT NULL DEFAULT ""; ALTER TABLE `talert_snmp` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; ALTER TABLE `talert_snmp` MODIFY COLUMN `al_field11` text NOT NULL, MODIFY COLUMN `al_field12` text NOT NULL, @@ -1268,6 +1273,7 @@ ALTER TABLE `talert_snmp` MODIFY COLUMN `al_field11` text NOT NULL, MODIFY COLUMN `al_field14` text NOT NULL, MODIFY COLUMN `al_field15` text NOT NULL; + -- --------------------------------------------------------------------- -- Table `talert_snmp_action` -- --------------------------------------------------------------------- diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index ee6ad32a26..68e9ebb2e6 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -1,16 +1,17 @@ $al_field13, 'al_field14' => $al_field14, 'al_field15' => $al_field15, + 'al_field16' => $al_field16, + 'al_field17' => $al_field17, + 'al_field18' => $al_field18, + 'al_field19' => $al_field19, + 'al_field20' => $al_field20, 'description' => $description, 'agent' => $source_ip, 'custom_oid' => $custom_value, @@ -267,7 +283,9 @@ if ($save_alert || $modify_alert) { al_field5 = '%s', al_field6 = '%s',al_field7 = '%s', al_field8 = '%s', al_field9 = '%s',al_field10 = '%s', al_field11 = '%s', al_field12 = '%s', al_field13 = '%s', - al_field14 = '%s', al_field15 = '%s', + al_field14 = '%s', al_field15 = '%s', al_field16 = '%s', + al_field17 = '%s', al_field18 = '%s', al_field19 = '%s', + al_field20 = '%s', description = '%s', agent = '%s', custom_oid = '%s', oid = '%s', time_threshold = %d, max_alerts = %d, min_alerts = %d, @@ -318,6 +336,11 @@ if ($save_alert || $modify_alert) { $al_field13, $al_field14, $al_field15, + $al_field16, + $al_field17, + $al_field18, + $al_field19, + $al_field20, $description, $source_ip, $custom_value, @@ -417,6 +440,11 @@ if ($update_alert || $duplicate_alert) { $al_field13 = $alert['al_field13']; $al_field14 = $alert['al_field14']; $al_field15 = $alert['al_field15']; + $al_field16 = $alert['al_field16']; + $al_field17 = $alert['al_field17']; + $al_field18 = $alert['al_field18']; + $al_field19 = $alert['al_field19']; + $al_field20 = $alert['al_field20']; $max_alerts = $alert['max_alerts']; $min_alerts = $alert['min_alerts']; $priority = $alert['priority']; @@ -490,6 +518,11 @@ if ($update_alert || $duplicate_alert) { $al_field13 = ''; $al_field14 = ''; $al_field15 = ''; + $al_field16 = ''; + $al_field17 = ''; + $al_field18 = ''; + $al_field19 = ''; + $al_field20 = ''; $max_alerts = 1; $min_alerts = 0; $priority = 0; @@ -547,10 +580,11 @@ if ($duplicate_alert) { id_alert, al_field1, al_field2, al_field3, al_field4, al_field5, al_field6, al_field7, al_field8, al_field9, al_field10, al_field11, - al_field12, al_field13, al_field14, al_field15, - description, alert_type, agent, custom_oid, oid, time_threshold, - times_fired, last_fired, max_alerts, min_alerts, - internal_counter, priority, + al_field12, al_field13, al_field14, al_field15, + al_field16, al_field17, al_field18, al_field19, + al_field20, description, alert_type, agent, custom_oid, + oid, time_threshold, times_fired, last_fired, + max_alerts, min_alerts, internal_counter, priority, '.db_escape_key_identifier('_snmp_f1_').', '.db_escape_key_identifier('_snmp_f2_').', '.db_escape_key_identifier('_snmp_f3_').', @@ -597,6 +631,11 @@ if ($duplicate_alert) { $al_field13, $al_field14, $al_field15, + $al_field16, + $al_field17, + $al_field18, + $al_field19, + $al_field20, $description, $alert_type, $source_ip, @@ -998,6 +1037,11 @@ if ($create_alert || $update_alert) { 'al_field13' => $al_field13, 'al_field14' => $al_field14, 'al_field15' => $al_field15, + 'al_field16' => $al_field16, + 'al_field17' => $al_field17, + 'al_field18' => $al_field18, + 'al_field19' => $al_field19, + 'al_field20' => $al_field20, ]; // Hidden div with help hint to fill with javascript @@ -1421,6 +1465,11 @@ if ($create_alert || $update_alert) { 'al_field13' => $al_field13, 'al_field14' => $al_field14, 'al_field15' => $al_field15, + 'al_field16' => $al_field16, + 'al_field17' => $al_field17, + 'al_field18' => $al_field18, + 'al_field19' => $al_field19, + 'al_field20' => $al_field20, ]; for ($i = 1; $i <= $config['max_macro_fields']; $i++) { diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 51b0eb8150..d45f7a964c 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -308,6 +308,11 @@ CREATE TABLE IF NOT EXISTS `talert_snmp` ( `al_field13` text NOT NULL, `al_field14` text NOT NULL, `al_field15` text NOT NULL, + `al_field16` text NOT NULL, + `al_field17` text NOT NULL, + `al_field18` text NOT NULL, + `al_field19` text NOT NULL, + `al_field20` text NOT NULL, `description` varchar(255) default '', `alert_type` int(2) unsigned NOT NULL default '0', `agent` varchar(100) default '', diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 0d3bc2652f..b16b22dbac 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1182,11 +1182,11 @@ sub pandora_execute_action ($$$$$$$$$;$) { _field13_ => $field13, _field14_ => $field14, _field15_ => $field15, - _field11_ => $field16, - _field12_ => $field17, - _field13_ => $field18, - _field14_ => $field19, - _field15_ => $field20, + _field16_ => $field16, + _field17_ => $field17, + _field18_ => $field18, + _field19_ => $field19, + _field20_ => $field20, _agentname_ => (defined ($agent)) ? $agent->{'nombre'} : '', _agentalias_ => (defined ($agent)) ? $agent->{'alias'} : '', _agent_ => (defined ($agent)) ? ($agent->{'alias'} ? $agent->{'alias'} : $agent->{'nombre'}) : '',