Fixes for the Oracl€.

This commit is contained in:
mdtrooper 2015-06-03 15:53:52 +02:00
parent 9bba19235e
commit 3ca9a23d0a
4 changed files with 39 additions and 8 deletions

View File

@ -115,8 +115,10 @@ if ($new_agent) {
$nombre_agente = $direccion_agente; $nombre_agente = $direccion_agente;
$servers = servers_get_names(); $servers = servers_get_names();
if (!empty($servers)) if (!empty($servers)) {
$server_name = reset(array_keys($servers)); $array_keys_servers = array_keys($servers);
$server_name = reset($array_keys_servers);
}
} }
if (!$new_agent) { if (!$new_agent) {
@ -138,6 +140,7 @@ if ($disk_conf_delete) {
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente">'; echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente">';
$table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = "databox filters"; $table->class = "databox filters";
@ -261,7 +264,9 @@ if (!array_key_exists($server_name, $servers)) {
$table->data[6][0] = __('Server'); $table->data[6][0] = __('Server');
if ($new_agent) { if ($new_agent) {
//Set first server by default. //Set first server by default.
$server_name = reset(array_keys(servers_get_names())); $servers_get_names = servers_get_names();
$array_keys_servers_get_names = array_keys($servers_get_names);
$server_name = reset($array_keys_servers_get_names);
} }
$table->data[6][1] = html_print_select (servers_get_names (), $table->data[6][1] = html_print_select (servers_get_names (),
'server_name', $server_name, '', __('None'), 0, true). ' ' . ui_print_help_icon ('agent_server', true); 'server_name', $server_name, '', __('None'), 0, true). ' ' . ui_print_help_icon ('agent_server', true);
@ -274,6 +279,7 @@ $table->data[7][1] = html_print_input_text ('comentarios', $comentarios,
html_print_table ($table); html_print_table ($table);
unset($table); unset($table);
$table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = "databox filters"; $table->class = "databox filters";
@ -388,6 +394,7 @@ $table->data[7][1] = html_print_checkbox('quiet', 1, $quiet, true);
ui_toggle(html_print_table ($table, true), __('Advanced options')); ui_toggle(html_print_table ($table, true), __('Advanced options'));
unset($table); unset($table);
$table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = "databox filters"; $table->class = "databox filters";

View File

@ -356,7 +356,7 @@ if ($id_agente) {
. '</a>'; . '</a>';
// Hidden subtab layer // Hidden subtab layer
$agent_wizard['sub_menu'] .= '<ul class="mn subsubmenu" style="display:none; float:none;">'; $agent_wizard['sub_menu'] = '<ul class="mn subsubmenu" style="display:none; float:none;">';
$agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">'; $agent_wizard['sub_menu'] .= '<li class="nomn tab_godmode" style="text-align: center;">';
$agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">' $agent_wizard['sub_menu'] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=agent_wizard&wizard_section=snmp_explorer&id_agente='.$id_agente.'">'
. html_print_image ("images/wand_snmp.png", true, array ( "title" => __('SNMP Wizard'))) . html_print_image ("images/wand_snmp.png", true, array ( "title" => __('SNMP Wizard')))

View File

@ -4118,6 +4118,18 @@ function reporting_general($report, $content) {
$data['value'] = null; $data['value'] = null;
} }
else { else {
switch ($config["dbtype"]) {
case "mysql":
case "postgresql":
break;
case "oracle":
if (preg_match("/[0-9]+,[0-9]E+[+-][0-9]+/", $d)) {
$d = oracle_format_float_to_php($d);
}
break;
}
if (!is_numeric($d)) { if (!is_numeric($d)) {
$data['value'] = $d; $data['value'] = $d;
} }

View File

@ -1408,6 +1408,7 @@ function reporting_html_monitor_report($table, $item, $mini) {
$table->colspan['module']['cell'] = 3; $table->colspan['module']['cell'] = 3;
$table->cellstyle['module']['cell'] = 'text-align: center;'; $table->cellstyle['module']['cell'] = 'text-align: center;';
$table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->head = array (); $table1->head = array ();
$table1->data = array (); $table1->data = array ();
@ -1700,6 +1701,7 @@ function reporting_html_general(&$table, $item) {
if (!empty($item["data"])) { if (!empty($item["data"])) {
switch ($item['subtype']) { switch ($item['subtype']) {
case REPORT_GENERAL_NOT_GROUP_BY_AGENT: case REPORT_GENERAL_NOT_GROUP_BY_AGENT:
$table1 = new stdClass();
$table1->width = '99%'; $table1->width = '99%';
$table1->data = array (); $table1->data = array ();
$table1->head = array (); $table1->head = array ();
@ -1715,11 +1717,20 @@ function reporting_html_general(&$table, $item) {
$table1->style[3] = 'text-align: left'; $table1->style[3] = 'text-align: left';
foreach ($item['data'] as $row) { foreach ($item['data'] as $row) {
if ($item['date']['period'] != 0) {
$table1->data[] = array(
$row['agent'],
$row['module'],
$row['operator'],
$row['value']);
}
else {
$table1->data[] = array( $table1->data[] = array(
$row['agent'], $row['agent'],
$row['module'], $row['module'],
$row['value']); $row['value']);
} }
}
break; break;
case REPORT_GENERAL_GROUP_BY_AGENT: case REPORT_GENERAL_GROUP_BY_AGENT:
$list_modules = array(); $list_modules = array();
@ -1763,6 +1774,7 @@ function reporting_html_general(&$table, $item) {
} }
if ($item['resume'] && !empty($item["data"])) { if ($item['resume'] && !empty($item["data"])) {
$table_summary = new stdClass();
$table_summary->width = '99%'; $table_summary->width = '99%';
$table_summary->data = array (); $table_summary->data = array ();