mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2013-05-13 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_graph.php: fixed PHP warnings. * godmode/agentes/modificar_agente.php, include/functions_agents.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8124 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c5de827411
commit
b12b2d3b2e
@ -1,3 +1,10 @@
|
|||||||
|
2013-05-13 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_graph.php: fixed PHP warnings.
|
||||||
|
|
||||||
|
* godmode/agentes/modificar_agente.php,
|
||||||
|
include/functions_agents.php: cleaned source code style.
|
||||||
|
|
||||||
2013-05-10 Miguel de Dios <miguel.dedios@artica.es>
|
2013-05-10 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* operation/snmpconsole/snmp_browser.php: fixed the url to pure.
|
* operation/snmpconsole/snmp_browser.php: fixed the url to pure.
|
||||||
|
@ -87,12 +87,12 @@ if ($agent_to_delete) {
|
|||||||
|
|
||||||
// Check if the remote config file still exist
|
// Check if the remote config file still exist
|
||||||
if (isset ($config["remote_config"])) {
|
if (isset ($config["remote_config"])) {
|
||||||
$agent_md5 = md5 (agents_get_name($id_agente, ""), FALSE);
|
$agent_md5 = md5 (agents_get_name($id_agente, ""), FALSE);
|
||||||
|
|
||||||
if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5") ||
|
if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5") ||
|
||||||
file_exists ($config["remote_config"]."/conf/".$agent_md5.".conf")) {
|
file_exists ($config["remote_config"]."/conf/".$agent_md5.".conf")) {
|
||||||
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
|
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ if ($ag_group > 0) {
|
|||||||
%s',
|
%s',
|
||||||
$ag_group, $search_sql);
|
$ag_group, $search_sql);
|
||||||
$total_agents = db_get_sql ($sql);
|
$total_agents = db_get_sql ($sql);
|
||||||
|
|
||||||
$ag_groups = array();
|
$ag_groups = array();
|
||||||
$ag_groups = (array)$ag_group;
|
$ag_groups = (array)$ag_group;
|
||||||
if ($recursion) {
|
if ($recursion) {
|
||||||
|
@ -1758,7 +1758,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
|
|||||||
// db_process_delete_temp ("tagente_modulo", "id_agente", $id_agent);
|
// db_process_delete_temp ("tagente_modulo", "id_agente", $id_agent);
|
||||||
|
|
||||||
db_process_sql_update ('tagente_modulo',
|
db_process_sql_update ('tagente_modulo',
|
||||||
array ('delete_pending' => 1, 'disabled' => 1, 'nombre' => 'pendingdelete'),
|
array ('delete_pending' => 1, 'disabled' => 1, 'nombre' => 'pendingdelete'),
|
||||||
'id_agente = '. $id_agent);
|
'id_agente = '. $id_agent);
|
||||||
|
|
||||||
// Access entries
|
// Access entries
|
||||||
|
@ -2641,8 +2641,10 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||||||
$k++;
|
$k++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($is_unknown) {
|
if (isset($is_unknown)) {
|
||||||
$unknown_value++;
|
if ($is_unknown) {
|
||||||
|
$unknown_value++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the title and time format
|
// Set the title and time format
|
||||||
@ -2799,15 +2801,15 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||||||
': ' . $graph_stats['sum']['avg'] . ' ' . __('Min. Value').$series_suffix_str . ': ' . $graph_stats['sum']['min'] . ' ' . __('Units').$series_suffix_str . ': ' . $unit;
|
': ' . $graph_stats['sum']['avg'] . ' ' . __('Min. Value').$series_suffix_str . ': ' . $graph_stats['sum']['min'] . ' ' . __('Units').$series_suffix_str . ': ' . $unit;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////
|
||||||
if($show_events) {
|
if ($show_events) {
|
||||||
$legend['event'.$series_suffix] = __('Events').$series_suffix_str;
|
$legend['event'.$series_suffix] = __('Events').$series_suffix_str;
|
||||||
$chart_extra_data['legend_events'] = $legend['event'.$series_suffix];
|
$chart_extra_data['legend_events'] = $legend['event'.$series_suffix];
|
||||||
}
|
}
|
||||||
if($show_alerts) {
|
if ($show_alerts) {
|
||||||
$legend['alert'.$series_suffix] = __('Alerts').$series_suffix_str;
|
$legend['alert'.$series_suffix] = __('Alerts').$series_suffix_str;
|
||||||
$chart_extra_data['legend_alerts'] = $legend['alert'.$series_suffix];
|
$chart_extra_data['legend_alerts'] = $legend['alert'.$series_suffix];
|
||||||
}
|
}
|
||||||
if($show_unknown) {
|
if ($show_unknown) {
|
||||||
$legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str;
|
$legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str;
|
||||||
$chart_extra_data['legend_unknown'] = $legend['unknown'.$series_suffix];
|
$chart_extra_data['legend_unknown'] = $legend['unknown'.$series_suffix];
|
||||||
}
|
}
|
||||||
@ -2825,13 +2827,13 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||||||
}
|
}
|
||||||
//$legend['baseline'.$series_suffix] = __('Baseline').$series_suffix_str;
|
//$legend['baseline'.$series_suffix] = __('Baseline').$series_suffix_str;
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////
|
||||||
if($show_events) {
|
if ($show_events) {
|
||||||
$color['event'.$series_suffix] = array('border' => '#ff0000', 'color' => '#ff0000', 'alpha' => 50);
|
$color['event'.$series_suffix] = array('border' => '#ff0000', 'color' => '#ff0000', 'alpha' => 50);
|
||||||
}
|
}
|
||||||
if($show_alerts) {
|
if ($show_alerts) {
|
||||||
$color['alert'.$series_suffix] = array('border' => '#ff7f00', 'color' => '#ff7f00', 'alpha' => 50);
|
$color['alert'.$series_suffix] = array('border' => '#ff7f00', 'color' => '#ff7f00', 'alpha' => 50);
|
||||||
}
|
}
|
||||||
if($show_unknown) {
|
if ($show_unknown) {
|
||||||
$color['unknown'.$series_suffix] = array('border' => '#999999', 'color' => '#999999', 'alpha' => 50);
|
$color['unknown'.$series_suffix] = array('border' => '#999999', 'color' => '#999999', 'alpha' => 50);
|
||||||
}
|
}
|
||||||
$color['max'.$series_suffix] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
|
$color['max'.$series_suffix] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
|
||||||
@ -2872,7 +2874,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||||||
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
||||||
$unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix,
|
$unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix,
|
||||||
$series_suffix_str, $show_unknown);
|
$series_suffix_str, $show_unknown);
|
||||||
switch($compare) {
|
switch ($compare) {
|
||||||
case 'separated':
|
case 'separated':
|
||||||
// Store the chart calculated
|
// Store the chart calculated
|
||||||
$chart_prev = $chart;
|
$chart_prev = $chart;
|
||||||
@ -2889,7 +2891,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||||||
$legend_prev = $legend;
|
$legend_prev = $legend;
|
||||||
$series_type_prev = $series_type;
|
$series_type_prev = $series_type;
|
||||||
$color_prev = $color;
|
$color_prev = $color;
|
||||||
foreach($color_prev as $k => $col) {
|
foreach ($color_prev as $k => $col) {
|
||||||
$color_prev[$k]['color'] = '#'.get_complementary_rgb($color_prev[$k]['color']);
|
$color_prev[$k]['color'] = '#'.get_complementary_rgb($color_prev[$k]['color']);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2900,7 +2902,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
|
|||||||
|
|
||||||
if ($compare === 'overlapped') {
|
if ($compare === 'overlapped') {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach($chart as $k=>$v) {
|
foreach ($chart as $k=>$v) {
|
||||||
$chart[$k] = array_merge($v,$chart_prev[$i]);
|
$chart[$k] = array_merge($v,$chart_prev[$i]);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user