Merge branch 'develop' of https://github.com/pandorafms/pandorafms into develop

This commit is contained in:
m-lopez-f 2015-03-02 15:15:24 +01:00
commit f71aaf5cf7
4 changed files with 34 additions and 14 deletions

View File

@ -2228,18 +2228,32 @@ function agents_get_network_interfaces ($agents = false, $agents_filter = false)
$agent_group_id = $agent['id_grupo'];
$agent_name = $agent['nombre'];
$agent_interfaces = array();
$accepted_module_types = array();
$remote_snmp_proc = (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_snmp_proc");
if ($remote_snmp_proc)
$accepted_module_types[] = $remote_snmp_proc;
$remote_icmp_proc = (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_icmp_proc");
if ($remote_icmp_proc)
$accepted_module_types[] = $remote_icmp_proc;
$remote_tcp_proc = (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_tcp_proc");
if ($remote_tcp_proc)
$accepted_module_types[] = $remote_tcp_proc;
$generic_proc = (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "generic_proc");
if ($generic_proc)
$accepted_module_types[] = $generic_proc;
if (empty($accepted_module_types))
$accepted_module_types[] = 0; // No modules will be returned
$columns = array(
"id_agente_modulo",
"nombre",
"descripcion",
"ip_target"
);
$filter = array(
"id_agente" => $agent_id,
"id_tipo_modulo" => (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_snmp_proc"),
"disabled" => 0
);
$filter = " id_agente = $agent_id AND disabled = 0 AND id_tipo_modulo IN (".implode(",", $accepted_module_types).")";
$modules = agents_get_modules($agent_id, $columns, $filter, true, false);
if (!empty($modules)) {

View File

@ -206,7 +206,9 @@ function custom_graphs_print($id_graph, $height, $width, $period,
return;
}
if (empty($homeurl)) {
$homeurl = ui_get_full_url(false, false, false, false);
}
$output = graphic_combined_module($modules,
$weights,

View File

@ -1555,7 +1555,9 @@ function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0)
*
* @return array The module value and the timestamp
*/
function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0, $trash=false, $conexion = false, $order = 'ASC') {
function modules_get_agentmodule_data ($id_agent_module, $period,
$date = 0, $trash=false, $conexion = false, $order = 'ASC') {
$module = db_get_row('tagente_modulo', 'id_agente_modulo',
$id_agent_module);
@ -1580,7 +1582,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0, $tr
WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp %s",
$id_agent_module, $datelimit, $date, $order);
$id_agent_module, $datelimit, $date, $order);
break;
//log4x
case 24:
@ -1589,7 +1591,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0, $tr
WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp %s",
$id_agent_module, $datelimit, $date, $order);
$id_agent_module, $datelimit, $date, $order);
break;
default:
$sql = sprintf ("SELECT datos AS data, utimestamp
@ -1597,7 +1599,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0, $tr
WHERE id_agente_modulo = %d
AND utimestamp > %d AND utimestamp <= %d
ORDER BY utimestamp %s",
$id_agent_module, $datelimit, $date, $order);
$id_agent_module, $datelimit, $date, $order);
break;
}

View File

@ -1053,7 +1053,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
$('#menu_cancelzoom_' + graph_id).click(function() {
// cancel the zooming
plot = $.plot($('#'+graph_id), data_base,
plot = $.plot($('#' + graph_id), data_base,
$.extend(true, {}, options, {
xaxis: {max: max_x },
legend: { show: false }
@ -1075,9 +1075,11 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
// Add bottom margin in the legend
// Estimated height of 24 (works fine with this data in all browsers)
menu_height = 24;
var legend_margin_bottom = parseInt($('#legend_'+graph_id).css('margin-bottom').split('px')[0]);
var legend_margin_bottom = parseInt(
$('#legend_'+graph_id).css('margin-bottom').split('px')[0]);
$('#legend_'+graph_id).css('margin-bottom', menu_height+legend_margin_bottom+'px');
parent_height = parseInt($('#menu_'+graph_id).parent().css('height').split('px')[0]);
parent_height = parseInt(
$('#menu_'+graph_id).parent().css('height').split('px')[0]);
adjust_menu(graph_id, plot, parent_height);
}