awk vereinfacht

This commit is contained in:
Michael Grote 2021-09-21 21:42:17 +02:00
parent 318eaced1f
commit fcf7f546f0

View file

@ -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 {