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:
parent
fdfe79dcb6
commit
ee9558b727
1 changed files with 4 additions and 0 deletions
|
@ -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 }')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue