mirror of
https://github.com/munin-monitoring/muninlite.git
synced 2024-12-21 21:32:13 +01:00
commit
3b6ef20dc1
1 changed files with 7 additions and 9 deletions
16
plugins/df
16
plugins/df
|
@ -4,21 +4,19 @@ 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 -PT | grep '^/' | grep -vwE "$DF_IGNORE_FILESYSTEM_REGEX" | sed '/\/[a-z0-9]*$/!d;s/.* \([a-z0-9\/]\{1,\}\)$/\1/g')
|
||||
df -PT | grep '^/' | grep -vwE "$DF_IGNORE_FILESYSTEM_REGEX" | while read dev type blocks used avail pct mp
|
||||
do
|
||||
PINFO=$(df -P "$PART" | tail -1);
|
||||
PNAME=$(clean_fieldname "$(echo "$PINFO" | cut -d " " -f 1)")
|
||||
echo "$PNAME.label $PART"
|
||||
echo "$PNAME.info $PNAME -> $PART"
|
||||
PNAME=$(clean_fieldname "$mp")
|
||||
echo "$PNAME.label $mp"
|
||||
echo "$PNAME.info $dev -> $mp"
|
||||
echo "$PNAME.warning 92"
|
||||
echo "$PNAME.critical 98"
|
||||
done
|
||||
}
|
||||
fetch_df() {
|
||||
for PART in $(df -PT | grep '^/' | grep -vwE "$DF_IGNORE_FILESYSTEM_REGEX" | sed '/\/[a-z0-9]*$/!d;s/.* \([a-z0-9\/]\{1,\}\)$/\1/g')
|
||||
df -PT | grep '^/' | grep -vwE "$DF_IGNORE_FILESYSTEM_REGEX" | while read dev type blocks used avail pct mp
|
||||
do
|
||||
PINFO=$(df -P "$PART" | tail -1);
|
||||
PNAME=$(clean_fieldname "$(echo "$PINFO" | cut -d " " -f 1)")
|
||||
echo "$PNAME.value" "$(echo "$PINFO" | sed -e 's/\%//g' -e 's/ */ /g' | cut -d " " -f 5)"
|
||||
PNAME=$(clean_fieldname "$mp")
|
||||
echo "$PNAME.value" "${pct%\%}"
|
||||
done
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue