muninlite/plugins/df

25 lines
925 B
Text
Raw Normal View History

config_df() {
echo "graph_title Filesystem usage (in %)
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')
do
2020-02-07 15:15:06 +01:00
PINFO=$(df -P "$PART" | tail -1);
2020-10-07 13:10:13 +02:00
PNAME=$(clean_fieldname "$(echo "$PINFO" | cut -d " " -f 1)")
echo "$PNAME.label $PART"
echo "$PNAME.info $PNAME -> $PART"
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')
do
2020-02-07 15:15:06 +01:00
PINFO=$(df -P "$PART" | tail -1);
2020-10-07 13:10:13 +02:00
PNAME=$(clean_fieldname "$(echo "$PINFO" | cut -d " " -f 1)")
2020-02-07 15:15:06 +01:00
echo "$PNAME.value" "$(echo "$PINFO" | sed -e 's/\%//g' -e 's/ */ /g' | cut -d " " -f 5)"
done
}