Remove code, Already exists this feature in pandora

This commit is contained in:
m-lopez-f 2016-10-28 13:22:44 +02:00
parent 0a6782198d
commit f710fb0022
2 changed files with 10 additions and 75 deletions

View File

@ -249,7 +249,7 @@ if ($get_module_detail) {
foreach ($columns as $col => $attr) {
if ($attr[1] != "modules_format_data") {
$data[] = date('d F Y - h:i:s A', $row['utimestamp']);
$data[] = $attr[1] ($row[$attr[0]]);
}
elseif (($config['command_snapshot']) && (preg_match ("/[\n]+/i", $row[$attr[0]]))) {
@ -284,18 +284,7 @@ if ($get_module_detail) {
}
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
switch($row['module_type']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
$data[] = human_milliseconds_to_string($row['data']);
else
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
break;
default:
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
break;
}
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
//~ $data[] = (double) $row[$attr[0]];
}
else {
@ -921,34 +910,12 @@ if ($list_modules) {
$salida = $config["render_proc_fail"];
break;
default:
switch($module['id_tipo_modulo']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module['id_agente_modulo']);
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
$salida = human_milliseconds_to_string($module['datos']);
else
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
break;
default:
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
break;
}
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
break;
}
}
else {
switch($module['id_tipo_modulo']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module['id_agente_modulo']);
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
$salida = human_milliseconds_to_string($module['datos']);
else
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
break;
default:
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
break;
}
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
}
// Show units ONLY in numeric data types
if (isset($module["unit"])) {
@ -1078,9 +1045,6 @@ if(!is_snapshot_data($module['datos'])){
unset ($table);
unset ($table_data);
}
if ($get_type) {

View File

@ -187,40 +187,6 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
//~ $data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . format_numeric($last_data["datos"]) . "</span>";
//~ else
//~ $data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . substr(io_safe_output($last_data['datos']),0,12) . "</span>";
switch($module['id_tipo_modulo']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module['id_agente_modulo']);
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
$data = "<span title='" . human_milliseconds_to_string($last_data['datos']) . "' style='white-space: nowrap;'>" . human_milliseconds_to_string($last_data['datos']) . "</span>";
else
if (is_numeric($last_data["datos"]))
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else
$data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . substr(io_safe_output($last_data['datos']),0,12) . "</span>";
break;
default:
if (is_numeric($last_data["datos"]))
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else
$data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . substr(io_safe_output($last_data['datos']),0,12) . "</span>";
break;
}
break;
}
}
else {
switch($module['id_tipo_modulo']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module['id_agente_modulo']);
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0')
$data = "<span title='" . human_milliseconds_to_string($last_data['datos']) . "' style='white-space: nowrap;'>" . human_milliseconds_to_string($last_data['datos']) . "</span>";
else
if (is_numeric($last_data["datos"]))
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else
$data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . substr(io_safe_output($last_data['datos']),0,12) . "</span>";
break;
default:
if (is_numeric($last_data["datos"]))
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else
@ -228,7 +194,12 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
break;
}
}
else {
if (is_numeric($last_data["datos"]))
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
else
$data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . substr(io_safe_output($last_data['datos']),0,12) . "</span>";
}
if (!empty($last_data['utimestamp'])) {
$last_data_str = $data;