1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

adapt awk with variable + fix memory and disk multigraph name to align

This commit is contained in:
Younes Ichiche 2021-11-28 15:46:12 +01:00 committed by Lars Kruse
parent b43ec018dc
commit 9c3855beb8

View file

@ -339,7 +339,7 @@ function get_memory_value {
get_mem_total
get_mem_free
if [ "$MUNIN_CAP_DIRTYCONFIG" = "0" ] || [ -z "$MUNIN_CAP_DIRTYCONFIG" ]; then
echo multigraph memory_"$name"
echo multigraph memory_graph_"$name"
fi
while read -r line; do
echo "$line" | awk '/total-memory:/{
@ -360,9 +360,9 @@ function get_memory_value {
function get_disk_label {
while read -r line; do
echo "$line" | awk '/free-hdd-space:/{
print "multigraph disk_graph_""'"$name"'";
print "graph_title disk " "'"$name"'";
echo "$line" | awk -v name=$name '/free-hdd-space:/{
printf "multigraph disk_graph_%s\n", name;
printf "graph_title disk %s\n", name;
print "graph_vlabel Bytes";
print "graph_category mikrotik";
print "graph_args -l 0";
@ -373,7 +373,7 @@ function get_disk_label {
}
function get_disk_value {
if [ "$MUNIN_CAP_DIRTYCONFIG" = "0" ] || [ -z "$MUNIN_CAP_DIRTYCONFIG" ]; then
echo multigraph disk_"$name"
echo multigraph disk_graph_"$name"
fi
while read -r line; do
echo "$line" | grep KiB | awk '/free-hdd-space:/ {