2013-02-21 Sergio Martin <sergio.martin@artica.es>
* 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 godmode/alerts/configure_alert_action.php godmode/alerts/alert_commands.php: Update the commands data to new alerts macro in migration. Hide the not used fields on actions. bug #3605461 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7695 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c86f525048
commit
916e18ffbe
|
@ -1,3 +1,13 @@
|
|||
2013-02-21 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* 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
|
||||
godmode/alerts/configure_alert_action.php
|
||||
godmode/alerts/alert_commands.php: Update the commands data
|
||||
to new alerts macro in migration. Hide the not used fields
|
||||
on actions. bug #3605461
|
||||
|
||||
2013-02-21 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_graph.php
|
||||
|
|
|
@ -1079,3 +1079,15 @@ ALTER TABLE tevento ADD INDEX `idx_utimestamp` USING BTREE (`utimestamp`);
|
|||
ALTER TABLE tserver DROP INDEX keepalive;
|
||||
ALTER TABLE tserver DROP INDEX status;
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Adapt the talert commands to new macro system
|
||||
------------------------------------------------------------------------
|
||||
|
||||
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 = '["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;
|
||||
UPDATE talert_commands SET fields_descriptions = '["Destination number","Message","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 9;
|
||||
UPDATE talert_commands SET fields_descriptions = '["Agent name","Module name","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 10;
|
||||
|
|
|
@ -1082,3 +1082,16 @@ INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT
|
|||
INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 46,'AIX',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 46);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 47,'BSD',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 47);
|
||||
INSERT INTO tnetwork_component_group (id_sg, name, parent) SELECT * FROM (SELECT 48,'MacOS',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT id_sg FROM tnetwork_component_group WHERE id_sg = 48);
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Adapt the talert commands to new macro system
|
||||
------------------------------------------------------------------------
|
||||
|
||||
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 = '["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;
|
||||
UPDATE talert_commands SET fields_descriptions = '["Destination number","Message","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 9;
|
||||
UPDATE talert_commands SET fields_descriptions = '["Agent name","Module name","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 10;
|
||||
|
|
|
@ -1073,3 +1073,16 @@ INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM
|
|||
INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 46,'AIX',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 46);
|
||||
INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 47,'BSD',5 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 47);
|
||||
INSERT INTO "tnetwork_component_group" ("id_sg", "name", "parent") SELECT * FROM (SELECT 48,'MacOS',0 FROM dual) AS tmp WHERE NOT EXISTS (SELECT "id_sg" FROM "tnetwork_component_group" WHERE "id_sg" = 48);
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Adapt the talert commands to new macro system
|
||||
------------------------------------------------------------------------
|
||||
|
||||
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" = '["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;
|
||||
UPDATE "talert_commands" SET "fields_descriptions" = '["Destination number","Message","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 9;
|
||||
UPDATE "talert_commands" SET "fields_descriptions" = '["Agent name","Module name","","","","","","","",""]', fields_values = '["","","","","","","","","",""]' WHERE id = 10;
|
||||
|
|
|
@ -61,7 +61,13 @@ if (is_ajax ()) {
|
|||
$fdesc = $fields_descriptions[$i-1].' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), $i).'</span>';
|
||||
}
|
||||
else {
|
||||
$fdesc = sprintf(__('Field %s'), $i);
|
||||
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it
|
||||
if(substr_count($command['command'], "_field$i_") > 0) {
|
||||
$fdesc = sprintf(__('Field %s'), $i);
|
||||
}
|
||||
else {
|
||||
$fdesc = '';
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($fields_values[$i-1])) {
|
||||
|
@ -84,14 +90,20 @@ if (is_ajax ()) {
|
|||
$ffield = html_print_textarea ('field'.$i.'_value', 1, 1, '', 'style="min-height:40px" class="fields"', true);
|
||||
}
|
||||
|
||||
$fields_rows[$i] = '<tr id="table1-field'.$i.'" class="datos">
|
||||
<td style="font-weight:bold;width:20%" class="datos">
|
||||
'.$fdesc.'
|
||||
</td>
|
||||
<td class="datos">
|
||||
'.$ffield.'
|
||||
</td>
|
||||
</tr>';
|
||||
// The empty descriptions will be ignored
|
||||
if($fdesc == '') {
|
||||
$fields_rows[$i] = '';
|
||||
}
|
||||
else {
|
||||
$fields_rows[$i] = '<tr id="table1-field'.$i.'" class="datos">
|
||||
<td style="font-weight:bold;width:20%" class="datos">
|
||||
'.$fdesc.'
|
||||
</td>
|
||||
<td class="datos">
|
||||
'.$ffield.'
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
$command['fields_rows'] = $fields_rows;
|
||||
|
|
|
@ -206,8 +206,15 @@ $(document).ready (function () {
|
|||
old_value = $("[name=field"+i+"_value]").val();
|
||||
}
|
||||
|
||||
$('#table1-field'+i).replaceWith(data["fields_rows"][i]);
|
||||
$("[name=field"+i+"_value]").val(old_value);
|
||||
// If the row is empty, hide de row
|
||||
if(data["fields_rows"][i] == '') {
|
||||
$('#table1-field'+i).hide();
|
||||
}
|
||||
else {
|
||||
$('#table1-field'+i).replaceWith(data["fields_rows"][i]);
|
||||
$("[name=field"+i+"_value]").val(old_value);
|
||||
$('#table1-field').show();
|
||||
}
|
||||
}
|
||||
|
||||
render_command_preview(original_command);
|
||||
|
|
Loading…
Reference in New Issue