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:
mdtrooper 2013-05-13 10:52:51 +00:00
parent 2563a91ea5
commit b064082064
4 changed files with 28 additions and 19 deletions

View File

@ -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>
* operation/snmpconsole/snmp_browser.php: fixed the url to pure.

View File

@ -87,12 +87,12 @@ if ($agent_to_delete) {
// Check if the remote config file still exist
if (isset ($config["remote_config"])) {
$agent_md5 = md5 (agents_get_name($id_agente, ""), FALSE);
if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5") ||
file_exists ($config["remote_config"]."/conf/".$agent_md5.".conf")) {
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
}
$agent_md5 = md5 (agents_get_name($id_agente, ""), FALSE);
if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5") ||
file_exists ($config["remote_config"]."/conf/".$agent_md5.".conf")) {
ui_print_error_message(__('Maybe the files conf or md5 could not be deleted'));
}
}
}
@ -253,7 +253,7 @@ if ($ag_group > 0) {
%s',
$ag_group, $search_sql);
$total_agents = db_get_sql ($sql);
$ag_groups = array();
$ag_groups = (array)$ag_group;
if ($recursion) {

View File

@ -1758,7 +1758,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) {
// db_process_delete_temp ("tagente_modulo", "id_agente", $id_agent);
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);
// Access entries

View File

@ -2641,8 +2641,10 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
$k++;
}
if($is_unknown) {
$unknown_value++;
if (isset($is_unknown)) {
if ($is_unknown) {
$unknown_value++;
}
}
// 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;
/////////////////////////////////////////////////////////////////////////////////////////
if($show_events) {
if ($show_events) {
$legend['event'.$series_suffix] = __('Events').$series_suffix_str;
$chart_extra_data['legend_events'] = $legend['event'.$series_suffix];
}
if($show_alerts) {
if ($show_alerts) {
$legend['alert'.$series_suffix] = __('Alerts').$series_suffix_str;
$chart_extra_data['legend_alerts'] = $legend['alert'.$series_suffix];
}
if($show_unknown) {
if ($show_unknown) {
$legend['unknown'.$series_suffix] = __('Unknown').$series_suffix_str;
$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;
/////////////////////////////////////////////////////////////////////////////////////////
if($show_events) {
if ($show_events) {
$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);
}
if($show_unknown) {
if ($show_unknown) {
$color['unknown'.$series_suffix] = array('border' => '#999999', 'color' => '#999999', '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,
$unit_name, $show_alerts, $avg_only, $date-$period, $series_suffix,
$series_suffix_str, $show_unknown);
switch($compare) {
switch ($compare) {
case 'separated':
// Store the chart calculated
$chart_prev = $chart;
@ -2889,7 +2891,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
$legend_prev = $legend;
$series_type_prev = $series_type;
$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']);
}
break;
@ -2900,7 +2902,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
if ($compare === 'overlapped') {
$i = 0;
foreach($chart as $k=>$v) {
foreach ($chart as $k=>$v) {
$chart[$k] = array_merge($v,$chart_prev[$i]);
$i++;
}