Remove code, Already exists this feature in pandora
This commit is contained in:
parent
22e283c9b9
commit
ebbba31d57
|
@ -284,18 +284,7 @@ if ($get_module_detail) {
|
||||||
}
|
}
|
||||||
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
|
else if (is_numeric($row[$attr[0]]) && !modules_is_string_type($row['module_type']) ) {
|
||||||
|
|
||||||
switch($row['module_type']) {
|
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
|
||||||
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[] = (double) $row[$attr[0]];
|
//~ $data[] = (double) $row[$attr[0]];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -921,34 +910,12 @@ if ($list_modules) {
|
||||||
$salida = $config["render_proc_fail"];
|
$salida = $config["render_proc_fail"];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch($module['id_tipo_modulo']) {
|
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
|
||||||
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;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch($module['id_tipo_modulo']) {
|
$salida = remove_right_zeros(number_format($module["datos"], $config['graph_precision']));
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Show units ONLY in numeric data types
|
// Show units ONLY in numeric data types
|
||||||
if (isset($module["unit"])) {
|
if (isset($module["unit"])) {
|
||||||
|
@ -1076,9 +1043,6 @@ if ($list_modules) {
|
||||||
|
|
||||||
unset ($table);
|
unset ($table);
|
||||||
unset ($table_data);
|
unset ($table_data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($get_type) {
|
if ($get_type) {
|
||||||
|
|
|
@ -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>";
|
//~ $data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . format_numeric($last_data["datos"]) . "</span>";
|
||||||
//~ else
|
//~ else
|
||||||
//~ $data = "<span title='" . $last_data["datos"] . "' style='white-space: nowrap;'>" . substr(io_safe_output($last_data['datos']),0,12) . "</span>";
|
//~ $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='" . $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"]))
|
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>";
|
$data = "<span style='height: 20px; display: inline-table; vertical-align: top;'>" . remove_right_zeros(number_format($last_data["datos"], $config['graph_precision'])) . "</span>";
|
||||||
else
|
else
|
||||||
|
@ -228,6 +194,12 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head =
|
||||||
break;
|
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'])) {
|
if (!empty($last_data['utimestamp'])) {
|
||||||
$last_data_str = $data;
|
$last_data_str = $data;
|
||||||
|
|
||||||
|
|
|
@ -1285,34 +1285,12 @@ if (!empty($result)) {
|
||||||
$salida = $config['render_proc_fail'];
|
$salida = $config['render_proc_fail'];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch($row['module_type']) {
|
$salida = format_numeric($row['datos']);
|
||||||
case 15:
|
|
||||||
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $row['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($row['datos']);
|
|
||||||
else
|
|
||||||
$salida = format_numeric($row['datos']);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$salida = format_numeric($row['datos']);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch($row['module_type']) {
|
$salida = format_numeric($row['datos']);
|
||||||
case 15:
|
|
||||||
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $row['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($row['datos']);
|
|
||||||
else
|
|
||||||
$salida = format_numeric($row['datos']);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$salida = format_numeric($row['datos']);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show units ONLY in numeric data types
|
// Show units ONLY in numeric data types
|
||||||
|
|
Loading…
Reference in New Issue