2007-06-11 17:45:16 +02:00
|
|
|
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."
|
2009-03-17 13:35:31 +01:00
|
|
|
for PART in $(df -P | grep '^/' | sed '/\/[a-z0-9]*$/!d;s/.* \([a-z0-9\/]\{1,\}\)$/\1/g')
|
2007-06-11 17:45:16 +02:00
|
|
|
do
|
2009-03-17 13:35:31 +01:00
|
|
|
PINFO=$(df -P $PART | tail -1);
|
2007-06-11 17:45:16 +02:00
|
|
|
PNAME=$(echo $PINFO | cut -d\ -f1 | sed 's/\//_/g')
|
|
|
|
echo "$PNAME.label $PART"
|
|
|
|
echo "$PNAME.info $PNAME -> $PART"
|
|
|
|
echo "$PNAME.warning 92"
|
|
|
|
echo "$PNAME.critical 98"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
fetch_df() {
|
2009-03-17 13:35:31 +01:00
|
|
|
for PART in $(df -P | grep '^/' | sed '/\/[a-z0-9]*$/!d;s/.* \([a-z0-9\/]\{1,\}\)$/\1/g')
|
2007-06-11 17:45:16 +02:00
|
|
|
do
|
2009-03-17 13:35:31 +01:00
|
|
|
PINFO=$(df -P $PART | tail -1);
|
|
|
|
PNAME=$(echo $PINFO | cut -d\ -f1 | sed 's/[\/.-]/_/g')
|
2019-07-19 05:45:48 +02:00
|
|
|
echo "$PNAME.value" $(echo $PINFO | sed -e 's/\%//g' -e 's/ */ /g' | cut -f5 -d' ')
|
2007-06-11 17:45:16 +02:00
|
|
|
done
|
|
|
|
}
|