Ignore:
Timestamp:
02/20/14 10:36:15 (7 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
4f9718b
Parents:
e07f550
Message:

Add new functionality to Life-Preserver, now when the ZFS monitor runs,
check if disk-space is getting low on the Life-Preserver managed zpools.

If it is getting low, auto-prune the oldest snapshot to free up some additional
space.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/lpreserver/backend/zfsmon.sh

    r4c15f05 r44bdd65  
    2727if [ -e "${DBDIR}/zpool-alert-du" ] ; then rm ${DBDIR}/zpool-alert-du ; fi 
    2828 
    29 zpool list  | grep -v "^NAME" > /tmp/.lPreserver-df.$$ 
    30 while read line 
     29# Do the disk-space check 
     30for zpool in `zpool list -H | awk '{print $1}'` 
    3131do 
    32    cap=`echo $line | awk '{print $5}' | cut -d '%' -f 1` 
    33    zpool=`echo $line | awk '{print $1}'` 
    34    if [ $(is_num "$cap") ] ; then 
    35       if [ $cap -gt $DUWARN ] ; then 
    36          queue_msg "Warning! ${zpool} is currently at ${cap}% capacity!"         
    37          echo "$cap" > $DBDIR/zpool-alert-du 
    38          haveMsg=1 
    39       fi 
    40    fi 
    41 done< /tmp/.lPreserver-df.$$ 
    42 rm /tmp/.lPreserver-df.$$ 
     32  poolCap="`zpool list -H -o capacity $zpool | cut -d '%' -f 1`" 
     33 
     34  if [ $poolCap -gt $DUWARN ] ; then 
     35     queue_msg "Warning! ${zpool} is currently at ${poolCap}% capacity!" 
     36     echo "$poolCap" > $DBDIR/zpool-alert-du 
     37     haveMsg=1 
     38  fi 
     39 
     40  # See if we can do any auto-cleanup of this pool 
     41  if [ $poolCap -gt 85 ] ; then do_pool_cleanup "$zpool"; fi 
     42 
     43done 
    4344 
    4445# Lets check free disk space on the pools 
Note: See TracChangeset for help on using the changeset viewer.