mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
2012-12-06 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_agents.php, operation/integria_incidents/incident.php, godmode/massive/massive_delete_modules.php, godmode/modules/manage_network_templates_form.php, godmode/modules/manage_network_components_form_plugin.php, godmode/agentes/fields_manager.php, godmode/agentes/module_manager.php, godmode/users/profile_list.php, godmode/events/event_filter.php: cleaned source code style. * operation/tree.php: fixed the url to childrem consoles from the metaconsole tree. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7234 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2dcd884f15
commit
c422f1a9b5
@ -1,3 +1,17 @@
|
|||||||
|
2012-12-06 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_agents.php,
|
||||||
|
operation/integria_incidents/incident.php,
|
||||||
|
godmode/massive/massive_delete_modules.php,
|
||||||
|
godmode/modules/manage_network_templates_form.php,
|
||||||
|
godmode/modules/manage_network_components_form_plugin.php,
|
||||||
|
godmode/agentes/fields_manager.php,
|
||||||
|
godmode/agentes/module_manager.php, godmode/users/profile_list.php,
|
||||||
|
godmode/events/event_filter.php: cleaned source code style.
|
||||||
|
|
||||||
|
* operation/tree.php: fixed the url to childrem consoles from the
|
||||||
|
metaconsole tree.
|
||||||
|
|
||||||
2012-12-05 Ramon Novoa <rnovoa@artica.es>
|
2012-12-05 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* pandoradb_data.sql,
|
* pandoradb_data.sql,
|
||||||
|
@ -55,7 +55,7 @@ if ($create_field) {
|
|||||||
/* Update field */
|
/* Update field */
|
||||||
if ($update_field) {
|
if ($update_field) {
|
||||||
/*Check if name field is empty*/
|
/*Check if name field is empty*/
|
||||||
if( $name != "") {
|
if( $name != "") {
|
||||||
$values = array('name' => $name, 'display_on_front' => $display_on_front);
|
$values = array('name' => $name, 'display_on_front' => $display_on_front);
|
||||||
|
|
||||||
$result = db_process_sql_update('tagent_custom_fields', $values, array('id_field' => $id_field));
|
$result = db_process_sql_update('tagent_custom_fields', $values, array('id_field' => $id_field));
|
||||||
|
@ -136,7 +136,8 @@ if ($multiple_delete) {
|
|||||||
if (db_process_sql("UPDATE tagente_modulo
|
if (db_process_sql("UPDATE tagente_modulo
|
||||||
SET nombre = 'pendingdelete', disabled = 1, delete_pending = 1 WHERE id_agente_modulo = ".$id_agent_module_del, "affected_rows", '', true, $status, false) === false) {
|
SET nombre = 'pendingdelete', disabled = 1, delete_pending = 1 WHERE id_agente_modulo = ".$id_agent_module_del, "affected_rows", '', true, $status, false) === false) {
|
||||||
$error++;
|
$error++;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
// Update module status count
|
// Update module status count
|
||||||
if ($module !== false) {
|
if ($module !== false) {
|
||||||
if ($module['utimestamp'] == 0) {
|
if ($module['utimestamp'] == 0) {
|
||||||
@ -152,7 +153,7 @@ if ($multiple_delete) {
|
|||||||
}
|
}
|
||||||
db_process_sql ('UPDATE tagente SET total_count=total_count-1 WHERE id_agente=' . $module['id_agente']);
|
db_process_sql ('UPDATE tagente SET total_count=total_count-1 WHERE id_agente=' . $module['id_agente']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
@ -184,7 +185,7 @@ if ($multiple_delete) {
|
|||||||
if ($result === false)
|
if ($result === false)
|
||||||
$error++;
|
$error++;
|
||||||
} // Trick to detect if we are deleting components of synthetics modules (avg or arithmetic)
|
} // Trick to detect if we are deleting components of synthetics modules (avg or arithmetic)
|
||||||
else{
|
else {
|
||||||
$result_components = enterprise_hook('modules_get_synthetic_components', array($id_agent_module_del));
|
$result_components = enterprise_hook('modules_get_synthetic_components', array($id_agent_module_del));
|
||||||
$count_components = 1;
|
$count_components = 1;
|
||||||
if (!empty($result_components)){
|
if (!empty($result_components)){
|
||||||
|
@ -77,7 +77,7 @@ if ($multiple_delete) {
|
|||||||
|
|
||||||
db_process_sql_begin();
|
db_process_sql_begin();
|
||||||
|
|
||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
$result = db_process_sql_delete ('tevent_filter',
|
$result = db_process_sql_delete ('tevent_filter',
|
||||||
array ('id_filter' => $id));
|
array ('id_filter' => $id));
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ $table->head[2] = __('Event type');
|
|||||||
$table->head[3] = __('Event status');
|
$table->head[3] = __('Event status');
|
||||||
$table->head[4] = __('Severity');
|
$table->head[4] = __('Severity');
|
||||||
$table->head[5] = __('Action') .
|
$table->head[5] = __('Action') .
|
||||||
html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();');
|
html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();');
|
||||||
$table->style = array ();
|
$table->style = array ();
|
||||||
$table->style[0] = 'font-weight: bold';
|
$table->style[0] = 'font-weight: bold';
|
||||||
$table->align = array ();
|
$table->align = array ();
|
||||||
@ -156,7 +156,7 @@ foreach ($filters as $filter) {
|
|||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($data)) {
|
if (isset($data)) {
|
||||||
echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/event_filter'>";
|
echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/event_filter'>";
|
||||||
html_print_input_hidden('multiple_delete', 1);
|
html_print_input_hidden('multiple_delete', 1);
|
||||||
html_print_table ($table);
|
html_print_table ($table);
|
||||||
|
@ -96,14 +96,14 @@ $selection_mode = get_parameter('selection_mode', 'modules');
|
|||||||
$recursion = get_parameter('recursion');
|
$recursion = get_parameter('recursion');
|
||||||
|
|
||||||
if ($delete) {
|
if ($delete) {
|
||||||
if($selection_mode == 'modules') {
|
if ($selection_mode == 'modules') {
|
||||||
$force = get_parameter('force_type', false);
|
$force = get_parameter('force_type', false);
|
||||||
|
|
||||||
if($agents_select == false) {
|
if ($agents_select == false) {
|
||||||
$agents_select = array();
|
$agents_select = array();
|
||||||
$agents_ = array();
|
$agents_ = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($agents_select as $agent_name) {
|
foreach($agents_select as $agent_name) {
|
||||||
$agents_[] = agents_get_agent_id($agent_name);
|
$agents_[] = agents_get_agent_id($agent_name);
|
||||||
}
|
}
|
||||||
@ -111,40 +111,40 @@ if ($delete) {
|
|||||||
}
|
}
|
||||||
else if($selection_mode == 'agents') {
|
else if($selection_mode == 'agents') {
|
||||||
$force = get_parameter('force_group', false);
|
$force = get_parameter('force_group', false);
|
||||||
|
|
||||||
$agents_ = $agents_id;
|
$agents_ = $agents_id;
|
||||||
$modules_ = $modules_select;
|
$modules_ = $modules_select;
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$success = 0;
|
$success = 0;
|
||||||
|
|
||||||
// If the option to select all of one group or module type is checked
|
// If the option to select all of one group or module type is checked
|
||||||
if($force) {
|
if ($force) {
|
||||||
if($force == 'type') {
|
if ($force == 'type') {
|
||||||
$condition = '';
|
$condition = '';
|
||||||
if($module_type != 0)
|
if ($module_type != 0)
|
||||||
$condition = ' AND t2.id_tipo_modulo = '.$module_type;
|
$condition = ' AND t2.id_tipo_modulo = '.$module_type;
|
||||||
|
|
||||||
$agents_ = db_get_all_rows_sql('SELECT DISTINCT(t1.id_agente)
|
$agents_ = db_get_all_rows_sql('SELECT DISTINCT(t1.id_agente)
|
||||||
FROM tagente t1, tagente_modulo t2
|
FROM tagente t1, tagente_modulo t2
|
||||||
WHERE t1.id_agente = t2.id_agente');
|
WHERE t1.id_agente = t2.id_agente');
|
||||||
foreach($agents_ as $id_agent) {
|
foreach ($agents_ as $id_agent) {
|
||||||
$module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent, 'id_tipo_modulo' => $module_type),'nombre');
|
$module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent, 'id_tipo_modulo' => $module_type),'nombre');
|
||||||
|
|
||||||
if($module_name == false) {
|
if ($module_name == false) {
|
||||||
$module_name = array();
|
$module_name = array();
|
||||||
}
|
}
|
||||||
foreach($module_name as $mod_name) {
|
foreach ($module_name as $mod_name) {
|
||||||
$result = process_manage_delete ($mod_name['nombre'], $id_agent['id_agente']);
|
$result = process_manage_delete ($mod_name['nombre'], $id_agent['id_agente']);
|
||||||
$count ++;
|
$count ++;
|
||||||
$success += (int)$result;
|
$success += (int)$result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($force == 'group') {
|
else if ($force == 'group') {
|
||||||
$agents_ = array_keys (agents_get_group_agents ($group_select, false, "none"));
|
$agents_ = array_keys (agents_get_group_agents ($group_select, false, "none"));
|
||||||
foreach($agents_ as $id_agent) {
|
foreach ($agents_ as $id_agent) {
|
||||||
$module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent),'nombre');
|
$module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent),'nombre');
|
||||||
if($module_name == false) {
|
if($module_name == false) {
|
||||||
$module_name = array();
|
$module_name = array();
|
||||||
@ -291,7 +291,7 @@ echo '<h3 class="error invisible" id="message"> </h3>';
|
|||||||
ui_require_jquery_file ('form');
|
ui_require_jquery_file ('form');
|
||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
|
|
||||||
if($selection_mode == 'modules'){
|
if ($selection_mode == 'modules'){
|
||||||
$modules_row = '';
|
$modules_row = '';
|
||||||
$agents_row = 'none';
|
$agents_row = 'none';
|
||||||
}
|
}
|
||||||
@ -378,7 +378,7 @@ $(document).ready (function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('input[type=checkbox]').change (
|
$('input[type=checkbox]').change (
|
||||||
function () {
|
function () {
|
||||||
if(this.id == "checkbox-force_type"){
|
if(this.id == "checkbox-force_type"){
|
||||||
if(this.checked) {
|
if(this.checked) {
|
||||||
$(".select_modules_row_2").css('display', 'none');
|
$(".select_modules_row_2").css('display', 'none');
|
||||||
|
@ -42,19 +42,19 @@ $table->rowstyle['macro_field'] = 'display:none';
|
|||||||
push_table_row ($data, 'macro_field');
|
push_table_row ($data, 'macro_field');
|
||||||
|
|
||||||
// If there are $macros, we create the form fields
|
// If there are $macros, we create the form fields
|
||||||
if(!empty($macros)) {
|
if (!empty($macros)) {
|
||||||
$macros = json_decode($macros, true);
|
$macros = json_decode($macros, true);
|
||||||
|
|
||||||
foreach($macros as $k => $m) {
|
foreach ($macros as $k => $m) {
|
||||||
$data = array ();
|
$data = array ();
|
||||||
$data[0] = $m['desc'];
|
$data[0] = $m['desc'];
|
||||||
if(!empty($m['help'])) {
|
if (!empty($m['help'])) {
|
||||||
$data[0] .= ui_print_help_tip ($m['help'], true);
|
$data[0] .= ui_print_help_tip ($m['help'], true);
|
||||||
}
|
}
|
||||||
$data[1] = html_print_input_text($m['macro'], $m['value'], '', 15, 60, true);
|
$data[1] = html_print_input_text($m['macro'], $m['value'], '', 15, 60, true);
|
||||||
$table->colspan['macro'.$m['macro']][1] = 3;
|
$table->colspan['macro'.$m['macro']][1] = 3;
|
||||||
$table->rowclass['macro'.$m['macro']] = 'macro_field';
|
$table->rowclass['macro'.$m['macro']] = 'macro_field';
|
||||||
|
|
||||||
push_table_row ($data, 'macro'.$m['macro']);
|
push_table_row ($data, 'macro'.$m['macro']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
|
|||||||
//Submitted form
|
//Submitted form
|
||||||
$name = get_parameter_post ("name");
|
$name = get_parameter_post ("name");
|
||||||
$description = get_parameter_post ("description");
|
$description = get_parameter_post ("description");
|
||||||
if ($name != "") {
|
if ($name != "") {
|
||||||
if ($id_np > 0) {
|
if ($id_np > 0) {
|
||||||
//Profile exists
|
//Profile exists
|
||||||
$values = array(
|
$values = array(
|
||||||
@ -120,7 +120,7 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
|
|||||||
elseif ($id_np > 0) {
|
elseif ($id_np > 0) {
|
||||||
//Profile exists
|
//Profile exists
|
||||||
$row = db_get_row ("tnetwork_profile", "id_np", $id_np);
|
$row = db_get_row ("tnetwork_profile", "id_np", $id_np);
|
||||||
|
|
||||||
$description = $row["description"];
|
$description = $row["description"];
|
||||||
$name = $row["name"];
|
$name = $row["name"];
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ if ($delete_profile) {
|
|||||||
if ($ret === false) {
|
if ($ret === false) {
|
||||||
ui_print_error_message(__('There was a problem deleting the profile'));
|
ui_print_error_message(__('There was a problem deleting the profile'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
db_pandora_audit("Profile management",
|
db_pandora_audit("Profile management",
|
||||||
"Delete profile ". $profile['name']);
|
"Delete profile ". $profile['name']);
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ if ($update_profile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui_print_error_message(__('Profile name cannot be empty'));
|
ui_print_error_message(__('Profile name cannot be empty'));
|
||||||
}
|
}
|
||||||
$id_profile = 0;
|
$id_profile = 0;
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ if ($create_profile) {
|
|||||||
|
|
||||||
if ($name) {
|
if ($name) {
|
||||||
$ret = db_process_sql_insert('tperfil', $values);
|
$ret = db_process_sql_insert('tperfil', $values);
|
||||||
|
|
||||||
if ($ret !== false) {
|
if ($ret !== false) {
|
||||||
ui_print_success_message(__('Successfully created'));
|
ui_print_success_message(__('Successfully created'));
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ if ($create_profile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui_print_error_message(__('There was a problem creating this profile'));
|
ui_print_error_message(__('There was a problem creating this profile'));
|
||||||
}
|
}
|
||||||
$id_profile = 0;
|
$id_profile = 0;
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ $table->align = array_fill (1, 11, "center");
|
|||||||
$table->size = array_fill (1, 10, 40);
|
$table->size = array_fill (1, 10, 40);
|
||||||
|
|
||||||
$profiles = db_get_all_rows_in_table ("tperfil");
|
$profiles = db_get_all_rows_in_table ("tperfil");
|
||||||
if($profiles === false) {
|
if ($profiles === false) {
|
||||||
$profiles = array();
|
$profiles = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,19 +224,18 @@ foreach ($profiles as $profile) {
|
|||||||
$data[11] .= ' <a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile["id_perfil"].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'. html_print_image("images/cross.png", true) . '</a>';
|
$data[11] .= ' <a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile["id_perfil"].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'. html_print_image("images/cross.png", true) . '</a>';
|
||||||
array_push ($table->data, $data);
|
array_push ($table->data, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<form method="post" action="index.php?sec=gusuarios&sec2=godmode/users/configure_profile">';
|
|
||||||
if(isset($data)) {
|
|
||||||
html_print_table ($table);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo "<div class='nf'>".__('There are no defined profiles')."</div>";
|
|
||||||
}
|
|
||||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
|
||||||
html_print_input_hidden ('new_profile', 1);
|
|
||||||
html_print_submit_button (__('Create'), "crt", false, 'class="sub next"');
|
|
||||||
echo "</div>";
|
|
||||||
echo '</form>';
|
|
||||||
unset ($table);
|
|
||||||
|
|
||||||
?>
|
echo '<form method="post" action="index.php?sec=gusuarios&sec2=godmode/users/configure_profile">';
|
||||||
|
if (isset($data)) {
|
||||||
|
html_print_table ($table);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "<div class='nf'>".__('There are no defined profiles')."</div>";
|
||||||
|
}
|
||||||
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||||
|
html_print_input_hidden ('new_profile', 1);
|
||||||
|
html_print_submit_button (__('Create'), "crt", false, 'class="sub next"');
|
||||||
|
echo "</div>";
|
||||||
|
echo '</form>';
|
||||||
|
unset ($table);
|
||||||
|
?>
|
@ -359,27 +359,32 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
|||||||
switch ($filter['status']) {
|
switch ($filter['status']) {
|
||||||
// Normal
|
// Normal
|
||||||
case 0:
|
case 0:
|
||||||
$status_sql = "normal_count=total_count";
|
$status_sql =
|
||||||
|
"normal_count = total_count";
|
||||||
break;
|
break;
|
||||||
// Warning
|
// Warning
|
||||||
case 2:
|
case 2:
|
||||||
$status_sql = "critical_count=0 AND warning_count>0";
|
$status_sql =
|
||||||
|
"critical_count = 0 AND warning_count > 0";
|
||||||
break;
|
break;
|
||||||
// Critical
|
// Critical
|
||||||
case 1:
|
case 1:
|
||||||
$status_sql = "critical_count>0";
|
$status_sql =
|
||||||
|
"critical_count > 0";
|
||||||
break;
|
break;
|
||||||
// Unknown
|
// Unknown
|
||||||
case 3:
|
case 3:
|
||||||
$status_sql = "critical_count=0 AND warning_count=0 AND unknown_count>0";
|
$status_sql =
|
||||||
|
"critical_count = 0 AND warning_count = 0
|
||||||
|
AND unknown_count > 0";
|
||||||
break;
|
break;
|
||||||
// Not normal
|
// Not normal
|
||||||
case 4:
|
case 4:
|
||||||
$status_sql = "normal_count<>total_count";
|
$status_sql = "normal_count <> total_count";
|
||||||
break;
|
break;
|
||||||
// Not init
|
// Not init
|
||||||
case 5:
|
case 5:
|
||||||
$status_sql = "notinit_count=total_count";
|
$status_sql = "notinit_count = total_count";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
unset($filter['status']);
|
unset($filter['status']);
|
||||||
@ -459,10 +464,12 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($extra) {
|
if ($extra) {
|
||||||
$where = sprintf('(%s OR (%s)) AND (%s) AND (%s) %s', $sql_extra, $where, $where_nogroup, $status_sql, $search);
|
$where = sprintf('(%s OR (%s)) AND (%s) AND (%s) %s',
|
||||||
|
$sql_extra, $where, $where_nogroup, $status_sql, $search);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$where = sprintf('%s AND %s AND (%s) %s', $where, $where_nogroup, $status_sql, $search);
|
$where = sprintf('%s AND %s AND (%s) %s',
|
||||||
|
$where, $where_nogroup, $status_sql, $search);
|
||||||
}
|
}
|
||||||
$sql = sprintf('SELECT %s
|
$sql = sprintf('SELECT %s
|
||||||
FROM tagente
|
FROM tagente
|
||||||
|
@ -35,46 +35,46 @@ $update_incident = get_parameter('update_incident', 0);
|
|||||||
$integria_api = $config['integria_url']."/include/api.php?return_type=xml&user=".$config['id_user']."&pass=".$config['integria_api_password'];
|
$integria_api = $config['integria_url']."/include/api.php?return_type=xml&user=".$config['id_user']."&pass=".$config['integria_api_password'];
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
if($tab == 'list' || $tab == 'editor') {
|
if ($tab == 'list' || $tab == 'editor') {
|
||||||
$buttons = array(
|
$buttons = array(
|
||||||
'list' => array(
|
'list' => array(
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=list">' .
|
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=list">' .
|
||||||
html_print_image ("images/page_white_text.png", true, array ("title" => __('Incidents'))) .'</a>'),
|
html_print_image ("images/page_white_text.png", true, array ("title" => __('Incidents'))) .'</a>'),
|
||||||
'editor' => array(
|
'editor' => array(
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=editor">' .
|
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=editor">' .
|
||||||
html_print_image ("images/add.png", true, array ("title" => __('New Incident'))) .'</a>'));
|
html_print_image ("images/add.png", true, array ("title" => __('New Incident'))) .'</a>'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$buttons = array(
|
$buttons = array(
|
||||||
'list' => array(
|
'list' => array(
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=list">' .
|
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=list">' .
|
||||||
html_print_image ("images/page_white_text.png", true, array ("title" => __('Incidents'))) .'</a>'),
|
html_print_image ("images/page_white_text.png", true, array ("title" => __('Incidents'))) .'</a>'),
|
||||||
'incident' => array(
|
'incident' => array(
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=incident&id_incident='.$id_incident.'">' .
|
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=incident&id_incident='.$id_incident.'">' .
|
||||||
html_print_image ("images/eye.png", true, array ("title" => __('Incident details'))) .'</a>'),
|
html_print_image ("images/eye.png", true, array ("title" => __('Incident details'))) .'</a>'),
|
||||||
'workunits' => array(
|
'workunits' => array(
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=workunits&id_incident='.$id_incident.'">' .
|
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=workunits&id_incident='.$id_incident.'">' .
|
||||||
html_print_image ("images/computer.png", true, array ("title" => __('Workunits'))) .'</a>'),
|
html_print_image ("images/computer.png", true, array ("title" => __('Workunits'))) .'</a>'),
|
||||||
'files' => array(
|
'files' => array(
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=files&id_incident='.$id_incident.'"">' .
|
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=files&id_incident='.$id_incident.'"">' .
|
||||||
html_print_image ("images/file.png", true, array ("title" => __('Files'))) .'</a>'),
|
html_print_image ("images/file.png", true, array ("title" => __('Files'))) .'</a>'),
|
||||||
'tracking' => array(
|
'tracking' => array(
|
||||||
'active' => false,
|
'active' => false,
|
||||||
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=tracking&id_incident='.$id_incident.'"">' .
|
'text' => '<a href="index.php?login=1&sec=incidencias&sec2=operation/integria_incidents/incident&tab=tracking&id_incident='.$id_incident.'"">' .
|
||||||
html_print_image ("images/comments.png", true, array ("title" => __('Tracking'))) .'</a>'));
|
html_print_image ("images/comments.png", true, array ("title" => __('Tracking'))) .'</a>'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$buttons[$tab]['active'] = true;
|
$buttons[$tab]['active'] = true;
|
||||||
|
|
||||||
ui_print_page_header (__('Incident management'), "images/book_edit.png", false, "", false, $buttons);
|
ui_print_page_header (__('Incident management'), "images/book_edit.png", false, "", false, $buttons);
|
||||||
|
|
||||||
if($update_incident == 1) {
|
if ($update_incident == 1) {
|
||||||
$values[0] = $id_incident;
|
$values[0] = $id_incident;
|
||||||
$values[1] = urlencode(io_safe_output(get_parameter('title')));
|
$values[1] = urlencode(io_safe_output(get_parameter('title')));
|
||||||
$values[2] = urlencode(io_safe_output(get_parameter('description')));
|
$values[2] = urlencode(io_safe_output(get_parameter('description')));
|
||||||
@ -105,7 +105,7 @@ if($update_incident == 1) {
|
|||||||
|
|
||||||
$create_incident = get_parameter('create_incident', 0);
|
$create_incident = get_parameter('create_incident', 0);
|
||||||
|
|
||||||
if($create_incident == 1) {
|
if ($create_incident == 1) {
|
||||||
|
|
||||||
$values[0] = urlencode(io_safe_output(get_parameter('title')));
|
$values[0] = urlencode(io_safe_output(get_parameter('title')));
|
||||||
$values[1] = get_parameter('group');
|
$values[1] = get_parameter('group');
|
||||||
@ -132,8 +132,8 @@ if($create_incident == 1) {
|
|||||||
|
|
||||||
$attach_file = get_parameter('attach_file', 0);
|
$attach_file = get_parameter('attach_file', 0);
|
||||||
|
|
||||||
if($attach_file == 1) {
|
if ($attach_file == 1) {
|
||||||
if($_FILES['new_file']['name'] != "" && $_FILES['new_file']['error'] == 0) {
|
if ($_FILES['new_file']['name'] != "" && $_FILES['new_file']['error'] == 0) {
|
||||||
$file_content = file_get_contents($_FILES["new_file"]["tmp_name"]);
|
$file_content = file_get_contents($_FILES["new_file"]["tmp_name"]);
|
||||||
|
|
||||||
$values[0] = $id_incident;
|
$values[0] = $id_incident;
|
||||||
@ -172,6 +172,7 @@ if($attach_file == 1) {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ui_print_error_message (__('Generic upload error').'(Code: '.$_FILES['new_file']['error'].')');
|
ui_print_error_message (__('Generic upload error').'(Code: '.$_FILES['new_file']['error'].')');
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ if (is_ajax ())
|
|||||||
if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) {
|
if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) {
|
||||||
$enterpriseEnable = true;
|
$enterpriseEnable = true;
|
||||||
require_once ('enterprise/include/functions_policies.php');
|
require_once ('enterprise/include/functions_policies.php');
|
||||||
|
require_once ('enterprise/meta/include/functions_ui_meta.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = get_parameter('type');
|
$type = get_parameter('type');
|
||||||
@ -59,10 +60,11 @@ if (is_ajax ())
|
|||||||
$server = metaconsole_get_connection ($server_name);
|
$server = metaconsole_get_connection ($server_name);
|
||||||
metaconsole_connect($server);
|
metaconsole_connect($server);
|
||||||
$console_url = $server['server_url'] . '/';
|
$console_url = $server['server_url'] . '/';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$console_url = '';
|
$console_url = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
treeview_printTable($id_agente, $console_url);
|
treeview_printTable($id_agente, $console_url);
|
||||||
|
|
||||||
if (defined ('METACONSOLE')) {
|
if (defined ('METACONSOLE')) {
|
||||||
@ -123,7 +125,7 @@ if (is_ajax ())
|
|||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
$countRows = count ($rows);
|
$countRows = count ($rows);
|
||||||
|
|
||||||
//Empty Branch
|
//Empty Branch
|
||||||
if ($countRows === 0) {
|
if ($countRows === 0) {
|
||||||
echo "<ul style='margin: 0; padding: 0;'>\n";
|
echo "<ul style='margin: 0; padding: 0;'>\n";
|
||||||
@ -144,7 +146,7 @@ if (is_ajax ())
|
|||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$count++;
|
$count++;
|
||||||
|
|
||||||
$agent_info["monitor_alertsfired"] = $row["fired_count"];
|
$agent_info["monitor_alertsfired"] = $row["fired_count"];
|
||||||
$agent_info["monitor_critical"] = $row["critical_count"];
|
$agent_info["monitor_critical"] = $row["critical_count"];
|
||||||
$agent_info["monitor_warning"] = $row["warning_count"];
|
$agent_info["monitor_warning"] = $row["warning_count"];
|
||||||
@ -223,7 +225,7 @@ if (is_ajax ())
|
|||||||
if ($agent_info["monitor_normal"] > 0)
|
if ($agent_info["monitor_normal"] > 0)
|
||||||
echo ' : <span class="green">'.$agent_info["monitor_normal"].'</span>';
|
echo ' : <span class="green">'.$agent_info["monitor_normal"].'</span>';
|
||||||
echo ")";
|
echo ")";
|
||||||
|
|
||||||
if ($row['quiet']) {
|
if ($row['quiet']) {
|
||||||
echo " ";
|
echo " ";
|
||||||
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
|
html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => ""));
|
||||||
@ -244,7 +246,7 @@ if (is_ajax ())
|
|||||||
case 'agent_module':
|
case 'agent_module':
|
||||||
case 'agent_tag':
|
case 'agent_tag':
|
||||||
$fatherType = str_replace('agent_', '', $type);
|
$fatherType = str_replace('agent_', '', $type);
|
||||||
|
|
||||||
if (defined ('METACONSOLE')) {
|
if (defined ('METACONSOLE')) {
|
||||||
$server = metaconsole_get_connection ($server_name);
|
$server = metaconsole_get_connection ($server_name);
|
||||||
if (metaconsole_connect($server) != NOERR) {
|
if (metaconsole_connect($server) != NOERR) {
|
||||||
@ -258,7 +260,7 @@ if (is_ajax ())
|
|||||||
if (defined ('METACONSOLE')) {
|
if (defined ('METACONSOLE')) {
|
||||||
metaconsole_restore_db();
|
metaconsole_restore_db();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($countRows === 0) {
|
if ($countRows === 0) {
|
||||||
echo "<ul style='margin: 0; padding: 0;'>\n";
|
echo "<ul style='margin: 0; padding: 0;'>\n";
|
||||||
echo "<li style='margin: 0; padding: 0;'>";
|
echo "<li style='margin: 0; padding: 0;'>";
|
||||||
@ -356,14 +358,64 @@ if (is_ajax ())
|
|||||||
|
|
||||||
if (defined ('METACONSOLE')) {
|
if (defined ('METACONSOLE')) {
|
||||||
$console_url = $server['server_url'] . '/';
|
$console_url = $server['server_url'] . '/';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$console_url = '';
|
$console_url = '';
|
||||||
}
|
}
|
||||||
$link ="winopeng('" . $console_url . "operation/agentes/stat_win.php?type=$graph_type&period=86400&id=".$row["id_agente_modulo"]."&label=".base64_encode($row["nombre"])."&refresh=600','day_".$win_handle."')";
|
|
||||||
echo '<a href="javascript:'.$link.'">' . html_print_image ("images/chart_curve.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . '</a>';
|
|
||||||
|
//Icon and link to the Module graph.
|
||||||
|
if (defined('METACONSOLE')) {
|
||||||
|
$url_module_graph = ui_meta_get_url_console_child(
|
||||||
|
$server['id'], null, null, null, null,
|
||||||
|
"operation/agentes/stat_win.php?" .
|
||||||
|
"type=$graph_type&" .
|
||||||
|
"period=86400&" .
|
||||||
|
"id=" . $row["id_agente_modulo"] . "&" .
|
||||||
|
"label=" . base64_encode($row["nombre"]) . "&" .
|
||||||
|
"refresh=600");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$url_module_graph = $console_url .
|
||||||
|
"operation/agentes/stat_win.php?" .
|
||||||
|
"type=$graph_type&" .
|
||||||
|
"period=86400&" .
|
||||||
|
"id=" . $row["id_agente_modulo"] . "&" .
|
||||||
|
"label=" . base64_encode($row["nombre"]) . "&" .
|
||||||
|
"refresh=600";
|
||||||
|
}
|
||||||
|
$link ="winopeng('" . $url_module_graph . "','day_".$win_handle."')";
|
||||||
|
echo '<a href="javascript: '.$link.'">' . html_print_image ("images/chart_curve.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . '</a>';
|
||||||
|
|
||||||
|
|
||||||
echo " ";
|
echo " ";
|
||||||
echo "<a href='" . $console_url . "index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=" . $row['id_agente'] . "&tab=data_view&period=86400&id=".$row["id_agente_modulo"]."'>" . html_print_image ("images/binary.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . "</a>";
|
|
||||||
|
|
||||||
|
//Icon and link to the Module data.
|
||||||
|
if (defined('METACONSOLE')) {
|
||||||
|
|
||||||
|
$url_module_data = ui_meta_get_url_console_child(
|
||||||
|
$server['id'],
|
||||||
|
"estado", "operation/agentes/ver_agente",
|
||||||
|
"id_agente=" . $row['id_agente'] . "&" .
|
||||||
|
"tab=data_view&" .
|
||||||
|
"period=86400&" .
|
||||||
|
"id=" . $row["id_agente_modulo"]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$url_module_data = $console_url .
|
||||||
|
"index.php?" .
|
||||||
|
"sec=estado&" .
|
||||||
|
"sec2=operation/agentes/ver_agente&" .
|
||||||
|
"id_agente=" . $row['id_agente'] . "&" .
|
||||||
|
"tab=data_view&" .
|
||||||
|
"period=86400&" .
|
||||||
|
"id=" . $row["id_agente_modulo"];
|
||||||
|
}
|
||||||
|
echo "<a href='" . $url_module_data . "'>" . html_print_image ("images/binary.png", true, array ("style" => 'vertical-align: middle;', "border" => "0" )) . "</a>";
|
||||||
|
|
||||||
echo " ";
|
echo " ";
|
||||||
|
|
||||||
echo io_safe_output($row['nombre']);
|
echo io_safe_output($row['nombre']);
|
||||||
if ($row['quiet']) {
|
if ($row['quiet']) {
|
||||||
echo " ";
|
echo " ";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user