#!/bin/bash

highdisk=`cat /dev/null`
> /tmp/highdisk.txt
df -h | grep -v "/vz/root"| grep -v Filesystem | while read disk
do
        perc=`echo $disk | awk {'print $5'} |cut -d% -f1`
#       echo "perc: $perc"
        if [[ $perc -ge 90 ]]; then
                highdisk="$highdisk -- Partition `echo $disk | awk {'print $1'}` mounted on `echo $disk | awk {'print $6'}` is $perc filled"
        else
                disksize=good
        fi
        echo "$highdisk" > /tmp/highdisk.txt
done


if [ "$( cat /tmp/highdisk.txt )" ]; then
        echo "Critical: `cat /tmp/highdisk.txt`"
        exit 2
else
        echo "OK: All disk partition fine"
        exit 0
fi
