2012-06-13 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_html.php, include/functions_reporting.php,
	include/functions_groups.php, include/functions_visual_map.php,
	include/ajax/reporting.ajax.php, include/functions_config.php,
	include/functions_ui.php, include/functions.php,
	extensions/agents_modules.php, extensions/module_groups.php,
	operation/incidents/incident.php,
	operation/incidents/incident_detail.php,
	operation/agentes/status_monitor.php,
	operation/agentes/estado_generalagente.php,
	operation/agentes/estado_agente.php,
	operation/agentes/ver_agente.php,
	operation/snmpconsole/snmp_view.php,
	operation/integria_incidents/incident.incident.php,
	operation/integria_incidents/incident.php: a lot of fixes in
	relation with entities and clean source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6537 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-06-13 15:29:00 +00:00
parent 51975ddeb9
commit a84e7f6267
20 changed files with 174 additions and 143 deletions

View File

@ -1,3 +1,21 @@
2012-06-13 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php, include/functions_reporting.php,
include/functions_groups.php, include/functions_visual_map.php,
include/ajax/reporting.ajax.php, include/functions_config.php,
include/functions_ui.php, include/functions.php,
extensions/agents_modules.php, extensions/module_groups.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php,
operation/agentes/ver_agente.php,
operation/snmpconsole/snmp_view.php,
operation/integria_incidents/incident.incident.php,
operation/integria_incidents/incident.php: a lot of fixes in
relation with entities and clean source code style.
2012-06-13 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* godmode/agentes/module_manager_editor.php: Fixed strings of link

View File

@ -220,7 +220,10 @@ function mainAgentsModules() {
echo "<tr style='height: 25px;'>";
echo "<td class='$rowcolor'><a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>" . ui_print_truncate_text(io_safe_output($agent['nombre']), 35, true, true, true, '...', 'font-size:10px; font-weight: bold;') . "</a></td>";
echo "<td class='$rowcolor'>
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>" .
ui_print_truncate_text(io_safe_output($agent['nombre']), 35, true, true, true, '...', 'font-size:10px; font-weight: bold;') .
"</a></td>";
$agent_modules = agents_get_modules($agent['id_agente']);
$nmodules = 0;

View File

@ -142,14 +142,14 @@ function mainModuleGroups() {
$agentGroups = users_get_groups ($config['id_user'], "AR", false);
$modelGroups = users_get_all_model_groups();
if(!empty($agentGroups) && !empty($modelGroups)) {
array_walk($modelGroups, 'translate'); //Translate all head titles to language is set
foreach ($modelGroups as $i => $n) {
$modelGroups[$i] = ui_print_truncate_text($n, 20);
}
$head = $modelGroups;
array_unshift($head, '&nbsp;');
@ -171,7 +171,7 @@ function mainModuleGroups() {
$row = array();
array_push($row, ui_print_truncate_text($name, 20));
foreach ($modelGroups as $idModelGroup => $modelGroup) {
$query = sprintf($sql,$idAgentGroup, $idModelGroup);
@ -191,12 +191,12 @@ function mainModuleGroups() {
}
}
}
}
}
$states = array();
if ($rowsDB !== false) {
foreach ($rowsDB as $rowDB) {
$states[$rowDB['estado']] = $rowDB['count'];
$states[$rowDB['estado']] = $rowDB['count'];
}
}
@ -215,14 +215,14 @@ function mainModuleGroups() {
else {
if ($fired) {
$color = '#ffa300'; //Orange when the cell for this model group and agent has at least one alert fired.
$color = '#ffa300'; //Orange when the cell for this model group and agent has at least one alert fired.
}
else if (array_key_exists(1,$states)) {
$color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
$font_color = '#ffffff';
$color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
$font_color = '#ffffff';
}
elseif (array_key_exists(2,$states)) {
$color = '#fce94f'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
$color = '#fce94f'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
}
elseif (array_key_exists(3,$states)) {
$color = '#babdb6'; //Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.

View File

@ -146,13 +146,13 @@ if ($get_metaconsole_hash_data) {
enterprise_include_once('include/functions_metaconsole.php');
$server = enterprise_hook('metaconsole_get_connection', array($server_name));
$pwd = $server["auth_token"]; // Create HASH login info
$pwd = $server["auth_token"]; // Create HASH login info
$user = $config["id_user"];
$hashdata = $user.$pwd;
$hashdata = md5($hashdata);
$url_hash = "&loginhash=auto&loginhash_data=$hashdata&loginhash_user=$user";
echo $url_hash;
return;
}
@ -163,7 +163,7 @@ if ($get_metaconsole_server_url) {
enterprise_include_once('include/functions_metaconsole.php');
$server = enterprise_hook('metaconsole_get_connection', array($server_name));
echo $server["server_url"];
return;
}

View File

@ -809,11 +809,11 @@ function get_event_types () {
$types = array ();
$types['unknown'] = __('Unknown');
$types['critical'] = __('Monitor Critical');
$types['warning'] = __('Monitor Warning');
$types['normal'] = __('Monitor Normal');
$types['normal'] = __('Monitor Normal');
$types['alert_fired'] = __('Alert fired');
$types['alert_recovered'] = __('Alert recovered');
$types['alert_ceased'] = __('Alert ceased');

View File

@ -80,14 +80,15 @@ function config_update_config () {
if ($update_config) {
db_pandora_audit("Setup", "Setup has changed");
} else {
}
else {
return false;
}
$style = (string) get_parameter ('style', $config["style"]);
if ($style != $config['style'])
$style = substr ($style, 0, strlen ($style) - 4);
config_update_value ('language', (string) get_parameter ('language', $config["language"]));
config_update_value ('remote_config', (string) get_parameter ('remote_config', $config["remote_config"]));
config_update_value ('block_size', (int) get_parameter ('block_size', $config["block_size"]));
@ -125,7 +126,7 @@ function config_update_config () {
config_update_value ('flash_charts', (bool) get_parameter ('flash_charts', $config["flash_charts"]));
config_update_value ('attachment_store', (string) get_parameter ('attachment_store', $config["attachment_store"]));
config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'));
config_update_value ('custom_logo', (string) get_parameter ('custom_logo', $config["custom_logo"]));
config_update_value ('history_db_enabled', (bool) get_parameter ('history_db_enabled', $config['history_db_enabled']));
config_update_value ('history_db_host', (string) get_parameter ('history_db_host', $config['history_db_host']));
@ -156,31 +157,31 @@ function config_update_config () {
config_update_value ('autocreate_blacklist', get_parameter ('autocreate_blacklist', $config['autocreate_blacklist']));
config_update_value ('default_remote_profile', get_parameter ('default_remote_profile', $config['default_remote_profile']));
config_update_value ('default_remote_group', get_parameter ('default_remote_group', $config['default_remote_group']));
config_update_value ('ldap_server', get_parameter ('ldap_server', $config['ldap_server']));
config_update_value ('ldap_port', get_parameter ('ldap_port', $config['ldap_port']));
config_update_value ('ldap_version', get_parameter ('ldap_version', $config['ldap_version']));
config_update_value ('ldap_start_tls', get_parameter ('ldap_start_tls', $config['ldap_start_tls']));
config_update_value ('ldap_base_dn', get_parameter ('ldap_base_dn', $config['ldap_base_dn']));
config_update_value ('ldap_login_attr', get_parameter ('ldap_login_attr', $config['ldap_login_attr']));
config_update_value ('ad_server', get_parameter ('ad_server', $config['ad_server']));
config_update_value ('ad_port', get_parameter ('ad_port', $config['ad_port']));
config_update_value ('ad_start_tls', get_parameter ('ad_start_tls', $config['ad_start_tls']));
config_update_value ('ad_domain', get_parameter ('ad_domain', $config['ad_domain']));
config_update_value ('rpandora_server', get_parameter ('rpandora_server', $config['rpandora_server']));
config_update_value ('rpandora_port', get_parameter ('rpandora_port', $config['rpandora_port']));
config_update_value ('rpandora_dbname', get_parameter ('rpandora_dbname', $config['rpandora_dbname']));
config_update_value ('rpandora_user', get_parameter ('rpandora_user', $config['rpandora_user']));
config_update_value ('rpandora_pass', get_parameter ('rpandora_pass', $config['rpandora_pass']));
config_update_value ('rbabel_server', get_parameter ('rbabel_server', $config['rbabel_server']));
config_update_value ('rbabel_port', get_parameter ('rbabel_port', $config['rbabel_port']));
config_update_value ('rbabel_dbname', get_parameter ('rbabel_dbname', $config['rbabel_dbname']));
config_update_value ('rbabel_user', get_parameter ('rbabel_user', $config['rbabel_user']));
config_update_value ('rbabel_pass', get_parameter ('rbabel_pass', $config['rbabel_pass']));
config_update_value ('rintegria_server', get_parameter ('rintegria_server', $config['rintegria_server']));
config_update_value ('rintegria_port', get_parameter ('rintegria_port', $config['rintegria_port']));
config_update_value ('rintegria_dbname', get_parameter ('rintegria_dbname', $config['rintegria_dbname']));
@ -199,9 +200,9 @@ function config_update_config () {
config_update_value ('api_password', get_parameter('api_password', ""));
config_update_value ('collection_max_size', get_parameter('collection_max_size', $config['collection_max_size']));
config_update_value ('font_size', get_parameter('font_size', $config['font_size']));
config_update_value ('refr', get_parameter('refr', $config['refr']));
config_update_value ('refr', get_parameter('refr', $config['refr']));
config_update_value ('vc_refr', get_parameter('vc_refr', $config['vc_refr']));
@ -228,10 +229,10 @@ function config_update_config () {
# Update of Pandora FMS license
$update_manager_installed = db_get_value('value', 'tconfig', 'token', 'update_manager_installed');
if ($update_manager_installed == 1) {
if (isset($_POST['license_info_key'])){
if (isset($_POST['license_info_key'])) {
$values = array("value" => get_parameter('license_info_key'));
$where = array("key" => 'customer_key');
$update_manage_settings_result = db_process_sql_update('tupdate_settings', $values, $where);
@ -245,7 +246,7 @@ function config_update_config () {
*/
function config_process_config () {
global $config;
$configs = db_get_all_rows_in_table ('tconfig');
if (empty ($configs)) {

View File

@ -654,45 +654,46 @@ function groups_get_group_row($id_group, $group_all, $group, &$printed_groups) {
else {
echo "<tr class='group_view_normal' style='height: 35px;'>";
}
// Group name
echo "<td class='group_view_data' style='font-weight: bold; font-size: 12px;'>&nbsp;&nbsp;";
echo $group['prefix'].ui_print_group_icon ($id_group, true, "groups_small", 'font-size: 7.5pt');
echo $group['prefix'] . ui_print_group_icon ($id_group, true, "groups_small", 'font-size: 7.5pt');
echo "&nbsp;<a class='group_view_data' href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$id_group'>";
echo ui_print_truncate_text($group['name'], 35);
echo "</a>";
echo "</td>";
echo "<td class='group_view_data' style='text-align: center; vertica-align: middle;'>";
if (check_acl ($config['id_user'], $id_group, "AW")) {
echo '<a href="index.php?sec=estado&sec2=operation/agentes/group_view&update_netgroup='.$id_group.'">' . html_print_image("images/target.png", true, array("border" => '0', "alt" => __('Force'))) . '</a>';
echo '<a href="index.php?sec=estado&sec2=operation/agentes/group_view&update_netgroup='.$id_group.'">' .
html_print_image("images/target.png", true, array("border" => '0', "alt" => __('Force'))) . '</a>';
}
echo "</td>";
// Total agents
echo "<td class='group_view_data' class='group_view_data' style='font-weight: bold; font-size: 18px; text-align: center;'>";
if ($data["total_agents"] > 0)
echo "<a class='group_view_data' style='font-weight: bold; font-size: 18px; text-align: center;'
href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$id_group'>";
//Total agent field given by function reporting_get_group_stats return the number of agents
//of this groups and its children. It was done to print empty fathers of children groups.
//We need to recalculate the total agents for this group here to get only the total agents
//for this group. Of course the group All (0) is a special case.
$data["total_agents"];
if($id_group != 0) {
if ($id_group != 0) {
$data["total_agents"] = db_get_sql ("SELECT COUNT(id_agente) FROM tagente
WHERE id_grupo = $id_group AND disabled = 0");
} else {
$data["total_agents"] = db_get_sql ("SELECT COUNT(id_agente) FROM tagente
WHERE disabled = 0");
WHERE id_grupo = $id_group AND disabled = 0");
}
else {
$data["total_agents"] = db_get_sql ("SELECT COUNT(id_agente) FROM tagente
WHERE disabled = 0");
}
echo $data["total_agents"];
echo "</a>";
// Agents unknown
if ($data["agents_unknown"] > 0) {
echo "<td class='group_view_data_unk' style='font-weight: bold; font-size: 18px; text-align: center;'>";

View File

@ -225,7 +225,7 @@ function html_print_select_groups($id_user = false, $privilege = "AR", $returnAl
$user_groups_tree = groups_get_groups_tree_recursive($user_groups, $parent_group);
}
$fields = array();
foreach ($user_groups_tree as $group) {
if (isset($config['text_char_long'])) {
@ -240,7 +240,7 @@ function html_print_select_groups($id_user = false, $privilege = "AR", $returnAl
$output = html_print_select ($fields, $name, $selected, $script, $nothing, $nothing_value,
$return, $multiple, false, $class, $disabled, $style, $option_style);
if ($return) {
return $output;
}

View File

@ -2116,7 +2116,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
case 1:
case 'simple_graph':
reporting_header_content($mini, $content, $report, $table, __('Simple graph'),
ui_print_truncate_text($agent_name, 75, false).' <br> ' . ui_print_truncate_text($module_name, 75, false));
ui_print_truncate_text($agent_name, 75, false).' <br> ' .
ui_print_truncate_text($module_name, 75, false));
//RUNNING
$table->colspan[1][0] = 4;
@ -2136,8 +2137,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"], '', 0, 0, true, true);
array_push ($table->data, $data);
break;
break;
case 'projection_graph':
reporting_header_content($mini, $content, $report, $table, __('Projection graph'),
ui_print_truncate_text($agent_name, 75, false).' <br> ' . ui_print_truncate_text($module_name, 75, false));
@ -2189,7 +2189,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
break;
case 'prediction_date':
reporting_header_content($mini, $content, $report, $table, __('Prediction date'),
ui_print_truncate_text($agent_name, 75, false).' <br> ' . ui_print_truncate_text($module_name, 75, false));
ui_print_truncate_text($agent_name, 75, false).' <br> ' .
ui_print_truncate_text($module_name, 75, false));
//RUNNING
$table->colspan[1][0] = 4;
@ -2664,7 +2665,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
// Put description at the end of the module (if exists)
$table->colspan[0][0] = 2;
if ($content["description"] != ""){
if ($content["description"] != "") {
$data_desc = array();
$data_desc[0] = $content["description"];
array_push ($table->data, $data_desc);
@ -2695,7 +2696,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
// Put description at the end of the module (if exists)
$table->colspan[1][0] = 3;
if ($content["description"] != ""){
if ($content["description"] != "") {
$data_desc = array();
$data_desc[0] = $content["description"];
array_push ($table->data, $data_desc);
@ -2813,10 +2814,9 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array ();
$data[0] = graph_custom_sql_graph($content["id_rc"], $sizgraph_w, 200, $content["type"], true);
array_push($table->data, $data);
break;
case 'event_report_group':
reporting_header_content($mini, $content, $report, $table, __('Group detailed event'),
ui_print_truncate_text(groups_get_name($content['id_group'], true), 60, false));
@ -2831,10 +2831,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data = array ();
$table->colspan[2][0] = 3;
$data[0] = reporting_get_group_detailed_event($content['id_group'], $content['period'], $report["datetime"], true);
array_push ($table->data, $data);
break;
case 'event_report_module':
reporting_header_content($mini, $content, $report, $table, __('Module detailed event'),
ui_print_truncate_text($agent_name, 70, false).' <br> ' . ui_print_truncate_text($module_name, 70, false));
@ -2875,7 +2875,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
// Put description at the end of the module (if exists)
$table->colspan[1][0] = 3;
if ($content["description"] != ""){
if ($content["description"] != "") {
$data_desc = array();
$data_desc[0] = $content["description"];
array_push ($table->data, $data_desc);
@ -2914,7 +2914,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
// Put description at the end of the module (if exists)
$table->colspan[1][0] = 3;
if ($content["description"] != ""){
if ($content["description"] != "") {
$data_desc = array();
$data_desc[0] = $content["description"];
array_push ($table->data, $data_desc);
@ -2933,10 +2933,10 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$datelimit = $report["datetime"] - $content['period'];
$result = db_get_all_rows_sql('SELECT *
FROM tagente_datos
WHERE id_agente_modulo = ' . $content['id_agent_module'] . '
AND utimestamp > ' . $datelimit . '
AND utimestamp <= ' . $report["datetime"]);
FROM tagente_datos
WHERE id_agente_modulo = ' . $content['id_agent_module'] . '
AND utimestamp > ' . $datelimit . '
AND utimestamp <= ' . $report["datetime"]);
// Adds string data if there is no numeric data
if ((count($result) < 0) or (!$result)){
@ -3024,7 +3024,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
// Put description at the end of the module (if exists)
$table->colspan[1][0] = 3;
if ($content["description"] != ""){
if ($content["description"] != "") {
$data_desc = array();
$data_desc[0] = $content["description"];
array_push ($table->data, $data_desc);
@ -3222,6 +3222,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
}
$unit = db_get_value('unit', 'tagente_modulo', 'id_agente_modulo', $row ['id_agent_module']);
$id_agent_module[$key] = $row['id_agent_module'];
$agent_name[$key] = $ag_name;
$module_name[$key] = $mod_name;
@ -3320,7 +3321,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$agent_list = array();
$modules_list = array();
$operation_list = array();
foreach ($generals as $general) {
foreach ($generals as $general) {
//Metaconsole connection
$server_name = $general ['server_name'];
if (($config ['metaconsole'] == 1) && $server_name != '') {

View File

@ -50,22 +50,22 @@ function ui_print_truncate_text($text, $numChars = 25, $showTextInAToopTip = tru
echo $text;
}
}
$text = io_safe_output($text);
if (mb_strlen($text, "UTF-8") > ($numChars)) {
$half_length = intval(($numChars - 3) / 2); // '/2' because [...] is in the middle of the word.
// Depending on the strange behavior of mb_strimwidth() itself,
// the 3rd parameter is not to be $numChars but the length of original text (just means 'large enough').
$truncateText2 = mb_strimwidth($text, (mb_strlen($text, "UTF-8") - $half_length), strlen($text), "", "UTF-8" );
$truncateText = mb_strimwidth($text, 0, ($numChars - $half_length), $suffix, "UTF-8");
$truncateText=$truncateText . $truncateText2;
$truncateText = $truncateText . $truncateText2;
if ($showTextInTitle) {
if ($style !== false){
$truncateText = '<span style="' . $style . '" title="'.$text.'">'.$truncateText.'</span>';
}
else{
else {
$truncateText = '<span title="'.$text.'">'.$truncateText.'</span>';
}
}
@ -73,21 +73,21 @@ function ui_print_truncate_text($text, $numChars = 25, $showTextInAToopTip = tru
if ($style !== false){
$truncateText = $truncateText . '<a href="#" class="tip">&nbsp;<span style="' . $style . '">' . $text . '</span></a>';
}
else{
else {
$truncateText = $truncateText . '<a href="#" class="tip">&nbsp;<span>' . $text . '</span></a>';
}
}
else{
if ($style !== false){
else {
if ($style !== false) {
$truncateText = '<span style="' . $style . '">'.$truncateText.'</span>';
}
}
}
else {
if ($style !== false){
if ($style !== false) {
$truncateText = '<span style="' . $style . '">' . $text . '</span>';
}
else{
else {
$truncateText = $text;
}
}
@ -687,7 +687,8 @@ function ui_format_alert_row ($alert, $compound = false, $agent = true, $url = '
}
}
elseif ($agent == 0) {
$data[$index['module_name']] .= ui_print_truncate_text(modules_get_agentmodule_name ($alert["id_agent_module"]), 30, false, true, true, '[&hellip;]', 'font-size: 7.2pt');
$data[$index['module_name']] .=
ui_print_truncate_text(modules_get_agentmodule_name ($alert["id_agent_module"]), 30, false, true, true, '[&hellip;]', 'font-size: 7.2pt');
}
else {
if ($agent_style !== false) {
@ -696,7 +697,8 @@ function ui_format_alert_row ($alert, $compound = false, $agent = true, $url = '
else {
$data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled);
}
$data[$index['module_name']] = ui_print_truncate_text (modules_get_agentmodule_name ($alert["id_agent_module"]), 30, false, true, true, '[&hellip;]', 'font-size: 7.2pt');
$data[$index['module_name']] =
ui_print_truncate_text (modules_get_agentmodule_name ($alert["id_agent_module"]), 30, false, true, true, '[&hellip;]', 'font-size: 7.2pt');
}
$data[$index['agent_name']] .= $disabledHtmlEnd;
@ -711,7 +713,7 @@ function ui_format_alert_row ($alert, $compound = false, $agent = true, $url = '
else {
$actionDefault = db_get_value_sql("SELECT id_alert_action FROM talert_compound_actions WHERE id_alert_compound = " . $alert['id']);
}
$data[$index['description']] .= $disabledHtmlStart . ui_print_truncate_text (io_safe_input ($description), 35, false, true, true, '[&hellip;]', 'font-size: 7.1pt') . $disabledHtmlEnd;
$data[$index['description']] .= $disabledHtmlStart . ui_print_truncate_text (io_safe_output($description), 35, false, true, true, '[&hellip;]', 'font-size: 7.1pt') . $disabledHtmlEnd;
$actions = alerts_get_alert_agent_module_actions ($alert['id'], false, $compound);

View File

@ -73,7 +73,6 @@ function visual_map_print_button_editor($idDiv, $label, $float = 'left', $disabl
echo $label;
echo '</span>';
echo '</div>';
}
function visual_map_print_item($layoutData) {

View File

@ -465,11 +465,11 @@ foreach ($agents as $agent) {
$data[0] .= ' | ';
$data[0] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent["id_agente"].'&tab=data">'.__('Data').'</a>';
if (check_acl ($config['id_user'], $agent["id_grupo"], "AW")) {
$data[0] .= ' | ';
$data[0] .= ' | ';
$data[0] .= '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$agent["id_agente"].'">'.__('Edit').'</a>';
}
$data[0] .= '</div>';
/*if (check_acl ($config['id_user'], $agent["id_grupo"], "AW")) {
$data[0] .= '<a href="index.php?sec=estado&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$agent["id_agente"].'">';
$data[0] .= html_print_image ("images/setup.png", true, array ("border" => 0, "width" => 16));
@ -479,7 +479,7 @@ foreach ($agents as $agent) {
$data[1] = ui_print_truncate_text($agent["description"], 50, false, true, true, '[&hellip;]', 'font-size: 6.5pt');
$data[2] = ui_print_os_icon ($agent["id_os"], false, true);
//The interval we are thinking that it must be the agent interval in this
//cell and it'snt the interval of modules.
// if ($agent_info["interval"] > $agent["intervalo"]) {
@ -505,12 +505,12 @@ foreach ($agents as $agent) {
if ($agent_info["monitor_normal"] > 0)
$data[5] .= ' : <span class="green">'.$agent_info["monitor_normal"].'</span>';
$data[5] .= '</b>';
$data[6] = $agent_info["status_img"];
$data[7] = $agent_info["alert_img"];
$last_time = strtotime ($agent["ultimo_contacto"]);
$now = time ();
$diferencia = $now - $last_time;

View File

@ -55,7 +55,7 @@ if (! check_acl ($config["id_user"], $agent["id_grupo"], "AR") && !$is_extra) {
echo '<div style="height: 10px">&nbsp;</div>';
//Floating div
echo '<div id="agent_access" style="float:right; width:320px; padding-top:11px;">';
echo '<div id="agent_access" style="float:right; width:320px; padding-top:10px;">';
if ($config["agentaccess"]){
echo '<b>'.__('Agent access rate (24h)').'</b><br />';
@ -149,21 +149,21 @@ if ($config['activate_gis']) {
$dataPositionAgent = gis_get_data_last_position_agent($agent['id_agente']);
echo '<tr><td class="datos2"><b>'.__('Position (Long, Lat)'). '</b></td>';
echo '<td class="datos2" colspan="2">';
if ($dataPositionAgent === false) {
echo __('There is no GIS data.');
}
else {
echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente='.$id_agente.'">';
if ($dataPositionAgent['description'] != "")
echo $dataPositionAgent['description'];
else
echo $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'];
echo "</a>";
}
echo '</td></tr>';
echo '<td class="datos2" colspan="2">';
if ($dataPositionAgent === false) {
echo __('There is no GIS data.');
}
else {
echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente='.$id_agente.'">';
if ($dataPositionAgent['description'] != "")
echo $dataPositionAgent['description'];
else
echo $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'];
echo "</a>";
}
echo '</td></tr>';
}
// If the url description is setted

View File

@ -582,9 +582,9 @@ foreach ($result as $row) {
if ($row["extended_info"] != "") {
$data[3] .= ui_print_help_tip ($row["extended_info"], true, '/images/comments.png');
}
$data[4] = ($row['module_interval'] == 0) ? $row['agent_interval'] : $row['module_interval'];
if($row['utimestamp'] == 0 && (($row['module_type'] < 21 || $row['module_type'] > 23) && $row['module_type'] != 100)){
$data[5] = ui_print_status_image(STATUS_MODULE_NO_DATA, __('NOT INIT'), true);
}
@ -611,13 +611,13 @@ foreach ($result as $row) {
break;
}
}
$data[6] = "";
if ($row['history_data'] == 1){
if ($row['history_data'] == 1) {
$graph_type = return_graphtype ($row["module_type"]);
$nombre_tipo_modulo = modules_get_moduletype_name ($row["module_type"]);
$handle = "stat".$nombre_tipo_modulo."_".$row["id_agente_modulo"];
$url = 'include/procesos.php?agente='.$row["id_agente_modulo"];

View File

@ -335,7 +335,7 @@ if (is_ajax ()) {
$size_bad_modules = 0;
else
$size_bad_modules = sizeof ($bad_modules);
// Modules down
if ($size_bad_modules > 0) {
echo '<strong>'.__('Monitors down').':</strong> '.$size_bad_modules.' / '.$total_modules;
@ -347,7 +347,7 @@ if (is_ajax ()) {
}
echo '</ul>';
}
// Alerts (if present)
$sql = sprintf ('SELECT COUNT(talert_template_modules.id)
FROM talert_template_modules, tagente_modulo, tagente
@ -414,7 +414,7 @@ if (is_ajax ()) {
$ips = $ips[count($ips)-1];
$ips = explode(',', $ips);
if(count($ips) == 1) {
if (count($ips) == 1) {
echo $ips[0];
}
else {
@ -427,14 +427,14 @@ if (is_ajax ()) {
}
return;
}
if ($get_group_status_tooltip) {
$id_group = (int) get_parameter ('id_group');
$group = db_get_row ('tgrupo', 'id_grupo', $id_group);
echo '<h3>' . html_print_image("images/groups_small/" . groups_get_icon ($group['id_grupo']) . ".png", true);
echo ui_print_truncate_text($group['nombre'],25,false,true,false).'</h3>';
echo ui_print_truncate_text($group['nombre'], 25, false, true, false) . '</h3>';
echo '<strong>'.__('Parent').':</strong> ';
if($group['parent'] == 0) {
if ($group['parent'] == 0) {
echo __('None').'<br />';
}
else {
@ -444,7 +444,7 @@ if (is_ajax ()) {
}
echo '<strong>'.__('Sons').':</strong> ';
$groups_sons = db_get_all_fields_in_table ('tgrupo', 'parent', $group['id_grupo']);
if($groups_sons === false){
if ($groups_sons === false) {
echo __('None').'<br />';
}
else {
@ -457,14 +457,14 @@ if (is_ajax ()) {
return;
}
if ($get_agent_id) {
$agent_name = (string) get_parameter ("agent_name");
echo agents_get_agent_id ($agent_name);
return;
}
return;
}
@ -759,7 +759,7 @@ switch($tab) {
break;
}
ui_print_page_header (__('Agent').'&nbsp;-&nbsp;'.ui_print_truncate_text(agents_get_name($id_agente),25, false) . $header_description, $icon, false, "", false, $onheader);
ui_print_page_header(__('Agent') . '&nbsp;-&nbsp;' . ui_print_truncate_text(agents_get_name($id_agente),25, false) . $header_description, $icon, false, "", false, $onheader);
switch ($tab) {
@ -772,10 +772,10 @@ switch ($tab) {
case "sla":
require ("sla_view.php");
break;
case "manage":
case "manage":
require ("estado_generalagente.php");
break;
case "main":
case "main":
require ("estado_generalagente.php");
require ("estado_monitores.php");
require ("alerts_status.php");

View File

@ -332,7 +332,8 @@ if ($count < 1) {
$data[0] .= '&nbsp;&nbsp;'.html_print_image ("images/attachment.png", true, array ("style" => "align:middle;"));
$data[1] = incidents_print_status_img ($row["estado"], true);
$data[2] = '<a href="index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;id='.$row["id_incidencia"].'">'.ui_print_truncate_text(io_safe_output($row["titulo"]),45).'</a>';
$data[2] = '<a href="index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;id='.$row["id_incidencia"].'">' .
ui_print_truncate_text(io_safe_output($row["titulo"]),45).'</a>';
$data[3] = incidents_print_priority_img ($row["prioridad"], true);
$data[4] = ui_print_group_icon ($row["id_grupo"], true);
$data[5] = ui_print_timestamp ($row["actualizacion"], true);
@ -344,7 +345,7 @@ if ($count < 1) {
} else {
$data[8] = '';
}
array_push ($table->data, $data);
}

View File

@ -181,7 +181,7 @@ elseif (isset ($_GET["insert_form"])) {
$id_creator = $config["id_user"];
$id_grupo = 0;
$id_agent = 0;
if (isset ($_GET["from_event"])) {
$event = get_parameter ("from_event");
$texto = io_safe_output(events_get_description ($event));

View File

@ -77,7 +77,7 @@ if(!isset($result['id_incidencia'])) {
unset ($event);
}
}
$table->width = "98%";
$table->class = "databox";
@ -87,25 +87,25 @@ $table->colspan[3][0] = 3;
$table->colspan[4][0] = 3;
$table->data[0][0] = "<b>".__('Title')."</b><br/>".html_print_input_text("title", $result['titulo'], '', 80, 255, true);
if(isset($result['id_incidencia'])) {
if (isset($result['id_incidencia'])) {
$table->data[1][2] = "<b>".__('Assigned user')."</b><br/>".html_print_select ($users, 'id_user', $result['id_usuario'], '', '', 0, true, false, false);
}
else {
$table->data[1][2] = "";
}
if (isset($groups)){
if (isset($groups)) {
$table->data[1][0] = "<b>".__('Group')."</b><br/>".html_print_select ($groups, 'group', $result['id_grupo'], '', '', 0, true, false, false);
}
$table->data[1][1] = "<b>".__('Priority')."</b><br/>".html_print_select (incidents_get_priorities (), 'priority', $result['prioridad'], '', '', 0, true, false, false);
$table->data[1][2] = "<b>".__('Creator')."</b><br/>".$result['id_creator'];
if(isset($result['id_incidencia'])) {
if (isset($result['id_incidencia'])) {
$table->data[2][0] = "<b>".__('Source')."</b><br/>".html_print_select ($sources, 'source', $result['origen'], '', '', 0, true, false, false);
$table->data[2][1] = "<b>".__('Resolution')."</b><br/>".html_print_select ($resolutions, 'resolution', $result['resolution'], '', '', 0, true, false, false);
$table->data[2][2] = "<b>".__('Status')."</b><br/>".html_print_select ($status, 'status', $result['estado'], '', '', 0, true, false, false);
}
if(is_array($result['descripcion'])) {
if (is_array($result['descripcion'])) {
$result['descripcion'] = "";
}

View File

@ -153,7 +153,7 @@ $delete_file = get_parameter('delete_file', 0);
if($delete_file != 0) {
$url = $integria_api."&op=delete_file&params=".$delete_file;
// Call the integria API
$result = incidents_call_api($url);
}
@ -162,7 +162,7 @@ $delete_incident = get_parameter('delete_incident', 0);
if($delete_incident != 0) {
$url = $integria_api."&op=delete_incident&params=".$delete_incident;
// Call the integria API
$result = incidents_call_api($url);
}

View File

@ -463,33 +463,37 @@ if ($traps !== false) {
//OID
if (empty ($trap["oid"])) {
$data[2] = __('N/A');
} else {
}
else {
$data[2] = enterprise_hook ('editor_link', array ($trap));
if ($data[2] === ENTERPRISE_NOT_HOOK) {
$data[2] = $trap["oid"];
}
}
//Value
//Value
if (empty ($trap["value"])) {
$data[3] = __('N/A');
} else {
}
else {
$data[3] = ui_print_truncate_text($trap["value"], 15, false);
}
//Custom
//Custom
if (empty ($trap["oid_custom"])) {
$data[4] = __('N/A');
} else {
}
else {
$data[4] = ui_print_truncate_text($trap["oid_custom"], 25, false);
}
//User
if (!empty ($trap["status"])) {
$data[5] = '<a href="index.php?sec=usuarios&sec2=operation/users/user_edit&ver='.$trap["id_usuario"].'">'.substr ($trap["id_usuario"], 0, 8).'</a>';
if (!empty($trap["id_usuario"]))
$data[5] .= ui_print_help_tip(get_user_fullname($trap["id_usuario"]), true);
} else {
}
else {
$data[5] = '--';
}
@ -501,13 +505,14 @@ if ($traps !== false) {
// Use alert severity if fired
if (!empty ($trap["alerted"])) {
$data[7] = html_print_image("images/pixel_yellow.png", true, array("width" => "20", "height" => "20", "border" => "0", "title" => __('Alert fired')));
} else {
}
else {
$data[7] = html_print_image("images/pixel_gray.png", true, array("width" => "20", "height" => "20", "border" => "0", "title" => __('Alert not fired')));
}
// Severity
// Severity
$table->rowclass[$idx] = get_priority_class ($severity);
//Actions
$data[8] = "";