diff --git a/plugins/oracle/oracle_sysstat_ b/plugins/oracle/oracle_sysstat_ index d2a2afc7..b6c6897a 100755 --- a/plugins/oracle/oracle_sysstat_ +++ b/plugins/oracle/oracle_sysstat_ @@ -495,7 +495,9 @@ config() { local line t fields field type draw label while IFS= read -r line do - eval 't=(' "$line" ')' + # split line into field,type,draw,label + # eval looks necessary to preserve whitespaces + eval "t=( ${line} )" field="${t[0]}" [ -z "$field" ] && continue fields+=( $field ) @@ -511,13 +513,19 @@ config() { echo graph_order "${fields[@]}" } +# wrapper for getfield_* getfield() { if [ -n "${getfield_func[$module]:-}" ]; then + # call getfield_* function with args if necessary + # eval looks necessary if args contain whitespaces eval "${getfield_func[$module]}" fi } +# wrapper for getvalue_* getvalue() { + # call getvalue_* function with args if necessary + # eval looks necessary if args contain whitespaces eval "${getvalue_func[$module]}" } @@ -525,7 +533,9 @@ getvalue_sysstat() { local line t field label while IFS= read -r line do - eval 't=(' "$line" ')' + # split line into field,type,draw,label + # eval looks necessary to preserve whitespaces + eval "t=( ${line} )" field="${t[0]}" [ -z "$field" ] && continue label="${t[3]}" @@ -550,7 +560,9 @@ getvalue_sgainfo() { local line t field label while IFS= read -r line do - eval 't=(' "$line" ')' + # split line into field,type,draw,label + # eval looks necessary to preserve whitespaces + eval "t=( ${line} )" field="${t[0]}" [ -z "$field" ] && continue label="${t[3]}" @@ -575,7 +587,9 @@ getvalue_pgastat() { local line t field label while IFS= read -r line do - eval 't=(' "$line" ')' + # split line into field,type,draw,label + # eval looks necessary to preserve whitespaces + eval "t=( ${line} )" field="${t[0]}" [ -z "$field" ] && continue label="${t[3]}"