diff --git a/plugins/df b/plugins/df index 623a1f1..2971618 100644 --- a/plugins/df +++ b/plugins/df @@ -4,9 +4,9 @@ graph_args --upper-limit 100 -l 0 graph_vlabel % graph_category disk graph_info This graph shows disk usage on the machine." - for PART in $(df | sed '/\/[a-z0-9]*$/!d;s/.* \([a-z0-9\/]\{1,\}\)$/\1/g') + for PART in $(df -P | grep '^/' | sed '/\/[a-z0-9]*$/!d;s/.* \([a-z0-9\/]\{1,\}\)$/\1/g') do - PINFO=$(df $PART | tail -1); + PINFO=$(df -P $PART | tail -1); PNAME=$(echo $PINFO | cut -d\ -f1 | sed 's/\//_/g') echo "$PNAME.label $PART" echo "$PNAME.info $PNAME -> $PART" @@ -15,10 +15,10 @@ graph_info This graph shows disk usage on the machine." done } fetch_df() { - for PART in $(df | sed '/\/[a-z0-9]*$/!d;s/.* \([a-z0-9\/]\{1,\}\)$/\1/g') + for PART in $(df -P | grep '^/' | sed '/\/[a-z0-9]*$/!d;s/.* \([a-z0-9\/]\{1,\}\)$/\1/g') do - PINFO=$(df $PART | tail -1); - PNAME=$(echo $PINFO | cut -d\ -f1 | sed 's/\//_/g') + PINFO=$(df -P $PART | tail -1); + PNAME=$(echo $PINFO | cut -d\ -f1 | sed 's/[\/.-]/_/g') echo "$PNAME.value" $(echo $PINFO | cut -f5 -d\ | sed -e 's/\%//g') done }