Home Directory

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory

lionbatata

Reviews(1)
bylionbatata, April 18, 2011
change the line:

## Get lv's and their df's
for vg in `lvs --noheadings --nosuffix --units b --separator " " --options vg_name`; do

for:

for vg in `vgs --noheadings --nosuffix --units b --separator " " --options vg_name`; do

For enhanced the output, change the entire block code as above:

## Get lv's and their df's
for vg in `vgs --noheadings --nosuffix --units b --separator " " --options vg_name`; do
for lv in `lvs --noheadings --nosuffix --units b --separator " " --options lv_name $vg`; do
if [[ `mount | grep $vg | grep $lv` ]]; then
dfout=`df -P --block-size=1 | grep $vg | grep $lv`
outper=`echo "$dfout" | grep --only-matching "[0-9]*%"`
outname="$vg/$lv"
outmount=`echo "$dfout" | awk '{print $6}'`
#`echo "$dfout" | awk '{ print $1 }'`
outnum=`expr match "$outper" '\([0-9]*\)'`
if [ $thresh_crit ] && [ "$outnum" -ge "$thresh_crit" ]; then
critflag=1
msgs="$msgs$outname/$outper ($outmount)"
elif [ $thresh_warn ] && [ "$outnum" -ge "$thresh_warn" ]; then
warnflag=1
msgs="$msgs$outname/$outper ($outmount)"
fi
fi
done
done