From 3dd16cc56841c25ff00eb09532c462381853c40a Mon Sep 17 00:00:00 2001 From: Younes Ichiche Date: Sun, 28 Nov 2021 18:53:03 +0100 Subject: [PATCH] represent the memory as a floating point with 0 after the dot so it will be rounded and not floored --- plugins/router/mikrotik_system | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/router/mikrotik_system b/plugins/router/mikrotik_system index 0346ebcf..67805a34 100755 --- a/plugins/router/mikrotik_system +++ b/plugins/router/mikrotik_system @@ -345,13 +345,13 @@ function get_memory_value { while read -r line; do echo "$line" | awk '/total-memory:/{ gsub(/MiB/,"",$2); - printf "total_memory.value %d\n", $2 + printf "total_memory.value %.0f\n", $2 }' done <<< "$data" while read -r line; do echo "$line" | awk '/free-memory:/{ gsub(/MiB/,"",$2); - printf "free_memory.value %d\n", $2 + printf "free_memory.value %.0f\n", $2 }' done <<< "$data" # berechne used-memory