From 6f15e97a4906ff92003d4d3ee5639496c1040ed7 Mon Sep 17 00:00:00 2001 From: Luis Calvo Date: Fri, 14 Jun 2019 16:13:01 +0200 Subject: [PATCH] Modified module show data Sys Uptime format --- pandora_console/include/ajax/module.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 76dc24e145..0d949c3b8b 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -392,11 +392,20 @@ if (check_login()) { switch ($row['module_type']) { case 15: $value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id); + // System Uptime: + // In case of System Uptime module, shows data in format "Days hours minutes seconds" if and only if + // selected module unit is "_timeticks_" + // Take notice that selected unit may not be postrocess unit if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') { if ($post_process > 0) { - $data[] = human_milliseconds_to_string(($row['data'] / $post_process)); + $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision'])); } else { - $data[] = human_milliseconds_to_string($row['data']); + $data_macro = modules_get_unit_macro($row[$attr[0]], $unit); + if ($data_macro) { + $data[] = $data_macro; + } else { + $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision'])); + } } } else { $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));