mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'develop' of https://github.com/pandorafms/pandorafms into develop
This commit is contained in:
commit
f71aaf5cf7
@ -2228,18 +2228,32 @@ function agents_get_network_interfaces ($agents = false, $agents_filter = false)
|
|||||||
$agent_group_id = $agent['id_grupo'];
|
$agent_group_id = $agent['id_grupo'];
|
||||||
$agent_name = $agent['nombre'];
|
$agent_name = $agent['nombre'];
|
||||||
$agent_interfaces = array();
|
$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(
|
$columns = array(
|
||||||
"id_agente_modulo",
|
"id_agente_modulo",
|
||||||
"nombre",
|
"nombre",
|
||||||
"descripcion",
|
"descripcion",
|
||||||
"ip_target"
|
"ip_target"
|
||||||
);
|
);
|
||||||
$filter = array(
|
$filter = " id_agente = $agent_id AND disabled = 0 AND id_tipo_modulo IN (".implode(",", $accepted_module_types).")";
|
||||||
"id_agente" => $agent_id,
|
|
||||||
"id_tipo_modulo" => (int) db_get_value("id_tipo", "ttipo_modulo", "nombre", "remote_snmp_proc"),
|
|
||||||
"disabled" => 0
|
|
||||||
);
|
|
||||||
$modules = agents_get_modules($agent_id, $columns, $filter, true, false);
|
$modules = agents_get_modules($agent_id, $columns, $filter, true, false);
|
||||||
|
|
||||||
if (!empty($modules)) {
|
if (!empty($modules)) {
|
||||||
|
@ -206,7 +206,9 @@ function custom_graphs_print($id_graph, $height, $width, $period,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($homeurl)) {
|
||||||
|
$homeurl = ui_get_full_url(false, false, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
$output = graphic_combined_module($modules,
|
$output = graphic_combined_module($modules,
|
||||||
$weights,
|
$weights,
|
||||||
|
@ -1555,7 +1555,9 @@ function modules_get_next_data ($id_agent_module, $utimestamp = 0, $string = 0)
|
|||||||
*
|
*
|
||||||
* @return array The module value and the timestamp
|
* @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',
|
$module = db_get_row('tagente_modulo', 'id_agente_modulo',
|
||||||
$id_agent_module);
|
$id_agent_module);
|
||||||
|
|
||||||
@ -1580,7 +1582,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0, $tr
|
|||||||
WHERE id_agente_modulo = %d
|
WHERE id_agente_modulo = %d
|
||||||
AND utimestamp > %d AND utimestamp <= %d
|
AND utimestamp > %d AND utimestamp <= %d
|
||||||
ORDER BY utimestamp %s",
|
ORDER BY utimestamp %s",
|
||||||
$id_agent_module, $datelimit, $date, $order);
|
$id_agent_module, $datelimit, $date, $order);
|
||||||
break;
|
break;
|
||||||
//log4x
|
//log4x
|
||||||
case 24:
|
case 24:
|
||||||
@ -1589,7 +1591,7 @@ function modules_get_agentmodule_data ($id_agent_module, $period, $date = 0, $tr
|
|||||||
WHERE id_agente_modulo = %d
|
WHERE id_agente_modulo = %d
|
||||||
AND utimestamp > %d AND utimestamp <= %d
|
AND utimestamp > %d AND utimestamp <= %d
|
||||||
ORDER BY utimestamp %s",
|
ORDER BY utimestamp %s",
|
||||||
$id_agent_module, $datelimit, $date, $order);
|
$id_agent_module, $datelimit, $date, $order);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$sql = sprintf ("SELECT datos AS data, utimestamp
|
$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
|
WHERE id_agente_modulo = %d
|
||||||
AND utimestamp > %d AND utimestamp <= %d
|
AND utimestamp > %d AND utimestamp <= %d
|
||||||
ORDER BY utimestamp %s",
|
ORDER BY utimestamp %s",
|
||||||
$id_agent_module, $datelimit, $date, $order);
|
$id_agent_module, $datelimit, $date, $order);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1053,7 +1053,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||||||
|
|
||||||
$('#menu_cancelzoom_' + graph_id).click(function() {
|
$('#menu_cancelzoom_' + graph_id).click(function() {
|
||||||
// cancel the zooming
|
// cancel the zooming
|
||||||
plot = $.plot($('#'+graph_id), data_base,
|
plot = $.plot($('#' + graph_id), data_base,
|
||||||
$.extend(true, {}, options, {
|
$.extend(true, {}, options, {
|
||||||
xaxis: {max: max_x },
|
xaxis: {max: max_x },
|
||||||
legend: { show: false }
|
legend: { show: false }
|
||||||
@ -1075,9 +1075,11 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
|
|||||||
// Add bottom margin in the legend
|
// Add bottom margin in the legend
|
||||||
// Estimated height of 24 (works fine with this data in all browsers)
|
// Estimated height of 24 (works fine with this data in all browsers)
|
||||||
menu_height = 24;
|
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');
|
$('#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);
|
adjust_menu(graph_id, plot, parent_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user