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

ignore empty lines

Ignore empty lines to prevent writing wrong lables.
This commit is contained in:
Marco Schmidt 2025-04-10 12:53:31 +02:00
parent fdfe79dcb6
commit ee9558b727

View file

@ -50,6 +50,8 @@ if [ "$1" = "config" ]; then
echo "graph_args -l 0 --base 1024"
echo "graph_info This graph shows the size per volume."
while IFS= read -r line; do
# ignore empty lines
[ -n "$line" ] || continue
echo "$line" | awk 'BEGIN { FS = ":" } { label = substr($1, 1, 30); print $1 ".label " label }'
# display info only when labels are set
if [ -n "$(echo "$line" | awk 'BEGIN { FS = ":" } { print $3 }')" ]; then
@ -62,6 +64,8 @@ fi
echo "multigraph volumesize"
while IFS= read -r line; do
# ignore empty lines
[ -n "$line" ] || continue
name=$(echo "$line" | awk 'BEGIN { FS = ":" } { print $1 }')
value=$(echo "$line" | awk 'BEGIN { FS = ":" } { print $2 }')