2012-09-17 Vanessa Gil <vanessa.gil@artica.es>

* operation/events/events_list.php
	  extensions/plugin_registration.php
	  operation/agentes/status_monitor.php
	  godmode/agentes/agent_template.php
	  godmode/massive/massive_edit_modules.php
	  godmode/modules/manage_network_templates.php
	  include/javascript/pandora_modules.js
	  include/functions_network_components.php: Added instructions to modules,
	events, policies, massive operations...


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6979 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2012-09-17 16:03:38 +00:00
parent 85f1fe1b08
commit 12fc75dab4
9 changed files with 68 additions and 31 deletions

View File

@ -1,3 +1,15 @@
2012-09-17 Vanessa Gil <vanessa.gil@artica.es>
* operation/events/events_list.php
extensions/plugin_registration.php
operation/agentes/status_monitor.php
godmode/agentes/agent_template.php
godmode/massive/massive_edit_modules.php
godmode/modules/manage_network_templates.php
include/javascript/pandora_modules.js
include/functions_network_components.php: Added instructions to modules,
events, policies, massive operations...
2012-09-17 Ramon Novoa <rnovoa@artica.es>
* include/javascript/pandora_modules.js,

View File

@ -175,6 +175,9 @@ function pluginreg_extension_main () {
'tcp_port' => isset($ini_array[$label]["tcp_port"]) ? $ini_array[$label]["tcp_port"] : '',
'critical_inverse' => isset($ini_array[$label]["critical_inverse"]) ? $ini_array[$label]["critical_inverse"] : '',
'warning_inverse' => isset($ini_array[$label]["warning_inverse"]) ? $ini_array[$label]["warning_inverse"] : '',
'critical_instructions' => isset($ini_array[$label]["critical_instructions"]) ? $ini_array[$label]["critical_instructions"] : '',
'warning_instructions' => isset($ini_array[$label]["warning_instructions"]) ? $ini_array[$label]["warning_instructions"] : '',
'unknown_instructions' => isset($ini_array[$label]["unknown_instructions"]) ? $ini_array[$label]["unknown_instructions"] : '',
'id_plugin' => $create_id);
db_process_sql_insert('tnetwork_component', $values);

View File

@ -88,6 +88,9 @@ if (isset ($_POST["template_id"])) {
'str_critical' => $row2['str_critical'],
'critical_inverse' => $row2['critical_inverse'],
'warning_inverse' => $row2['warning_inverse'],
'critical_instructions' => $row2['critical_instructions'],
'warning_instructions' => $row2['warning_instructions'],
'unknown_instructions' => $row2['unknown_instructions']
);
$id_agente_modulo = db_process_sql_insert('tagente_modulo', $values);

View File

@ -353,6 +353,18 @@ $table->data['edit8'][2] = __('Tags');
$table->data['edit8'][3] = html_print_select_from_sql ('SELECT id_tag, name FROM ttag ORDER BY name',
'id_tag[]', $id_tag, '',__('None'),'0', true, true, false, false);
$table->data['edit10'][0] = '<b>'.__('Critical instructions'). '</b>'. ui_print_help_tip(__("Instructions when the status is critical"), true);
$table->data['edit10'][1] = html_print_textarea ('critical_instructions', 2, 50, '', '', true);
$table->colspan['edit10'][1] = 3;
$table->data['edit11'][0] = '<b>'.__('Warning instructions'). '</b>'. ui_print_help_tip(__("Instructions when the status is warning"), true);
$table->data['edit11'][1] = html_print_textarea ('warning_instructions', 2, 50, '', '', true);
$table->colspan['edit11'][1] = 3;
$table->data['edit12'][0] = '<b>'.__('Unknown instructions').'</b>'. ui_print_help_tip(__("Instructions when the status is unknown"), true);
$table->data['edit12'][1] = html_print_textarea ('unknown_instructions', 2, 50, '', '', true);
$table->colspan['edit12'][1] = 3;
$table->data['edit9'][0] = __('Quiet');
$table->data['edit9'][0] .= ui_print_help_tip(__('The module still store data but the alerts and events will be stop'), true);
$table->data['edit9'][1] = html_print_select(array(-1 => __('No change'),
@ -417,7 +429,7 @@ $(document).ready (function () {
$(".select_modules_row_2").css('display', '');
}
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide ();
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide ();
if (this.value == '0') {
filter = '';
@ -452,7 +464,7 @@ $(document).ready (function () {
$("td#delete_table-0-1, td#delete_table-edit1-1, td#delete_table-edit2-1").css ("width", "300px");
$("#form_edit input[type=text]").attr ("value", "");
$("#form_edit input[type=checkbox]").not ("#checkbox-recursion").removeAttr ("checked");
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").show ();
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").show ();
}
function clean_lists() {
@ -460,7 +472,7 @@ $(document).ready (function () {
$("#module_name").html('<?php echo __('None'); ?>');
$("#agents").html('<?php echo __('None'); ?>');
$("#module").html('<?php echo __('None'); ?>');
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit36, tr#delete_table-edit37, tr#delete_table-edit38, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide ();
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit36, tr#delete_table-edit37, tr#delete_table-edit38, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide ();
$('input[type=checkbox]').attr('checked', false);
$('input[type=checkbox]').attr('disabled', true);
$('#module_type').val(-1);
@ -477,7 +489,7 @@ $(document).ready (function () {
else {
$(".select_modules_row_2").css('display', '');
if($('#module_name option:selected').val() == undefined) {
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide ();
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide ();
}
}
}
@ -492,12 +504,12 @@ $(document).ready (function () {
if(this.checked) {
$(".select_agents_row_2").css('display', 'none');
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").show ();
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").show ();
}
else {
$(".select_agents_row_2").css('display', '');
if($('#id_agents option:selected').val() == undefined) {
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide ();
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide ();
}
}
}
@ -545,7 +557,7 @@ $(document).ready (function () {
$(".select_agents_row_2").css('display', '');
}
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide ();
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8, tr#delete_table-edit10, tr#delete_table-edit11, tr#delete_table-edit12").hide ();
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
@ -652,4 +664,4 @@ function process_manage_edit ($module_name, $agents_select = null) {
return true;
}
?>
?>

View File

@ -101,7 +101,7 @@ if ($export_profile) {
components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid,
components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter,
components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical,
components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name
components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name, components.critical_instructions, components.warning_instructions, components.unknown_instructions
FROM `tnetwork_component` AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group
WHERE tpc.id_nc = components.id_nc
AND components.id_group = comp_group.id_sg
@ -113,7 +113,7 @@ if ($export_profile) {
components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid,
components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter,
components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical,
components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name
components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name, components.critical_instructions, components.warning_instructions, components.unknown_instructions
FROM \"tnetwork_component\" AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group
WHERE tpc.id_nc = components.id_nc
AND components.id_group = comp_group.id_sg
@ -125,7 +125,7 @@ if ($export_profile) {
components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid,
components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter,
components.max_timeout, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical,
components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name
components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name, components.critical_instructions, components.warning_instructions, components.unknown_instructions
FROM tnetwork_component AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group
WHERE tpc.id_nc = components.id_nc
AND components.id_group = comp_group.id_sg

View File

@ -342,7 +342,9 @@ function network_components_create_module_from_network_component ($id_network_co
'min_ff_event',
'critical_inverse',
'warning_inverse',
));
'module_critical_instructions',
'module_warning_instructions',
'module_unknown_instructions'));
if (empty ($component))
return false;
$values = $component;
@ -407,6 +409,9 @@ function network_components_duplicate_network_component ($id_local_component) {
$networkCopy['min_ff_event'] = $network['min_ff_event'];
$networkCopy['critical_inverse'] = $network['critical_inverse'];
$networkCopy['warning_inverse'] = $network['warning_inverse'];
$networkCopy['critical_instructions'] = $network['critical_instructions'];
$networkCopy['warning_instructions'] = $network['warning_instructions'];
$networkCopy['unknown_instructions'] = $network['unknown_instructions'];
return network_components_create_network_component ($name, $network['type'], $network['id_group'], $networkCopy);
}

View File

@ -86,6 +86,10 @@ function configure_modules_form () {
$("#text-unit").attr("value", '');
$("#text-critical_inverse").attr ("value", 0);
$("#text-warning_inverse").attr ("value", 0);
$("#textarea_critical_instructions").attr ("value", '');
$("#textarea_warning_instructions").attr ("value", '');
$("#textarea_unknown_instructions").attr ("value", '');
}
$("#local_component").change (function () {

View File

@ -404,6 +404,9 @@ switch ($config["dbtype"]) {
tagente_modulo.extended_info,
tagente_modulo.critical_inverse,
tagente_modulo.warning_inverse,
tagente_modulo.critical_instructions,
tagente_modulo.warning_instructions,
tagente_modulo.unknown_instructions,
tagente_estado.utimestamp AS utimestamp".$sql.") ORDER BY " . $order['field'] . " " . $order['order']
. " LIMIT ".$offset.",".$config["block_size"];
break;
@ -429,6 +432,11 @@ switch ($config["dbtype"]) {
tagente_modulo.max_critical,
tagente_modulo.str_critical,
tagente_modulo.extended_info,
tagente_modulo.critical_inverse,
tagente_modulo.warning_inverse,
tagente_modulo.critical_instructions,
tagente_modulo.warning_instructions,
tagente_modulo.unknown_instructions,
tagente_estado.utimestamp AS utimestamp".$sql.") LIMIT " . $config["block_size"] . " OFFSET " . $offset;
break;
case "oracle":
@ -455,6 +463,11 @@ switch ($config["dbtype"]) {
tagente_modulo.max_critical,
tagente_modulo.str_critical,
tagente_modulo.extended_info,
tagente_modulo.critical_inverse,
tagente_modulo.warning_inverse,
tagente_modulo.critical_instructions,
tagente_modulo.warning_instructions,
tagente_modulo.unknown_instructions,
tagente_estado.utimestamp AS utimestamp" . $sql;
$sql = oracle_recode_query ($sql, $set);
break;
@ -698,4 +711,4 @@ function toggle_full_value(id) {
$("#value_module_text_" + id).html(value_title);
}
</script>
</script>

View File

@ -1135,9 +1135,7 @@ foreach ($result as $event) {
$string .= '<i>- ' . __('Empty') . ' -</i>';
}
$string .= '</td></tr>';
}
if ($event["criticity"] == 3) {
} else if ($event["criticity"] == 3) {
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Warning instructions') . '</td><td align="left">';
if ($event["warning_instructions"] != '') {
$string .= $event["warning_instructions"];
@ -1148,9 +1146,7 @@ foreach ($result as $event) {
$string .= '<i>- ' . __('Empty') . ' -</i>';
}
$string .= '</td></tr>';
}
if ($event["criticity"] == 0) {
} else if ($event["criticity"] == 0) {
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Unknown instructions') . '</td><td align="left">';
if ($event["unknown_instructions"] != '') {
$string .= $event["unknown_instructions"];
@ -1163,17 +1159,6 @@ foreach ($result as $event) {
$string .= '</td></tr>';
}
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Unknown instructions') . '</td><td align="left">';
if ($event["unknown_instructions"] != '') {
$string .= $event["unknown_instructions"];
$string .= '</td></tr><tr>';
$odd = ($odd == '')? 'rowOdd' : '';
}
else {
$string .= '<i>- ' . __('Empty') . ' -</i>';
}
$string .= '</td></tr>';
$string .= '</table>';
$data = array($string);
@ -1489,4 +1474,4 @@ $(document).ready( function() {
});
});
/* ]]> */
</script>
</script>