mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix app docker (#14080)
* docker app: polling - RRD dataset and fields value mismatch RRD dataset definitions and fields array keys passed to data_update have to be in the same order. There is no match based on key before building the rrdtool update command. Fixes mem_perc ending as NaN because it ended with a value above 100 as it was given mem_limit bytes value. * docker app - remove misleading divider The mem_perc and cpu_usage are already in percent, no need to divide them by a hundred. The values were then made into milli percent or micro percent.
This commit is contained in:
@@ -2,6 +2,5 @@
|
||||
|
||||
$unit_text = 'CPU (%)';
|
||||
$rrdVar = 'cpu_usage';
|
||||
$divider = 100;
|
||||
|
||||
require 'docker-common.inc.php';
|
||||
|
@@ -2,6 +2,5 @@
|
||||
|
||||
$unit_text = 'Memory (%)';
|
||||
$rrdVar = 'mem_perc';
|
||||
$divider = 100;
|
||||
|
||||
require 'docker-common.inc.php';
|
||||
|
@@ -55,9 +55,9 @@ foreach ($docker_data as $data) {
|
||||
$fields = [
|
||||
'cpu_usage' => (float) $data['cpu'],
|
||||
'pids' => $data['pids'],
|
||||
'mem_limit' => convertToBytes($data['memory']['limit']),
|
||||
'mem_used' => convertToBytes($data['memory']['used']),
|
||||
'mem_perc' => (float) $data['memory']['perc'],
|
||||
'mem_used' => convertToBytes($data['memory']['used']),
|
||||
'mem_limit' => convertToBytes($data['memory']['limit']),
|
||||
];
|
||||
|
||||
$metrics[$container] = $fields;
|
||||
|
Reference in New Issue
Block a user