From fcf7f546f05b424dbb4223dd868ba065bbd399c9 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 21 Sep 2021 21:42:17 +0200 Subject: [PATCH] awk vereinfacht --- mikrotik/mt_system | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mikrotik/mt_system b/mikrotik/mt_system index c854fec..daa036b 100644 --- a/mikrotik/mt_system +++ b/mikrotik/mt_system @@ -25,7 +25,7 @@ # - [ ] total-hdd-space: 16.3MiB # - [ ] free-memory: 210.2MiB # - [ ] total-memory: 256.0MiB - # - [ ] limit als % von total + # - [ ] limit als % von total + war noch # - [ ] uptime: 1w4d22h29m28s # - [ ] linter # - [ ] doku für munin mit ==HEAD usw. @@ -289,10 +289,9 @@ function get_memory_label { print "total_memory.label total memory"; print "used_memory.label used memory"; print "free_memory.label free memory"; - print "graph_info Total, Used & free RAM." - }' - echo $line | awk '/free-memory:/{ gsub(/MiB/,"",$2); $zw=$2*0.9; print "used_memory.critical " $zw }' - + print "graph_info Total, Used & free RAM.", + gsub(/MiB/,"",$2); $zw=$2*0.9; + print "used_memory.critical " $zw }' done <<< "$data" } function get_memory_value {