Ignore:
Timestamp:
05/14/17 21:01:41 (8 years ago)
Author:
Daniela Dorner
Message:
added newdata, improved handling of limits
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Monitoring/CheckDU.sh

    r17617 r18857  
    88
    99# possible limits
    10 limits=( 209715200 524288000 1073741824 2147483648 )
    11 texts=(   "200 GB"  "500 GB"     "1 TB"     "2 TB" )
    12 
    13 # set standard limits
    14 lowlimit=1
    15 highlimit=2
     10limits=(  10485760 52428800 104857600 209715200 524288000 1073741824 2147483648 )
     11texts=(    "10 GB" "50 GB"   "100 GB"  "200 GB"  "500 GB"     "1 TB"     "2 TB" )
    1612
    1713# get paths depending on host
     
    1915#        data) dirs=( "/loc_data" "/daq" "/newdaq" )
    2016        data) dirs=( "/loc_data" )
     17              lowlimits=( 4 )
     18              highlimits=( 5 )
    2119              ;;
    2220         daq) dirs=( "/raid10" )
     21              lowlimits=( 4 )
     22              highlimits=( 5 )
    2323              ;;
    2424      newdaq) dirs=( "/fact" )
     25              lowlimits=( 5 )
     26              highlimits=( 6 )
     27              ;;
     28     newdata) dirs=( "/scratch" "/data1" "/data2" )
     29              lowlimits=( 1 4 4 )
     30              highlimits=( 2 5 5 )
     31              lowlimits=( 0 4 4 )
     32              highlimits=( 1 5 5 )
    2533              ;;
    2634   isdc-dl00) dirs=( "/gpfs" "/scratch" )
    27               highlimit=1
    28               # better: array of limits
     35              lowlimits=( 4 )
     36              highlimits=( 4 )
    2937              ;;
    3038           *) echo "no valid host "$HOSTNAME
     
    3644hour=`date +%k`
    3745
    38 # define disk space limit for check depending on the time
    39 if [ $hour -lt 8 ] || [ $hour -gt 15 ]
    40 then
    41    # during night
    42    dulimit=${limits[$lowlimit]}
    43    dutext=${texts[$lowlimit]}
    44 else
    45    # during day
    46    dulimit=${limits[$highlimit]}
    47    dutext=${texts[$highlimit]}
    48 fi
     46for (( i=0 ; i< ${#dirs[@]} ; i++ ))
     47do
     48   dir=${dirs[$i]}
     49   # define disk space limit for check depending on the time
     50   if [ $hour -lt 8 ] || [ $hour -gt 15 ]
     51   then
     52      # during night
     53      dulimit=${limits[${lowlimits[$i]}]}
     54      dutext=${texts[${lowlimits[$i]}]}
     55   else
     56      # during day
     57      dulimit=${limits[${highlimits[$i]}]}
     58      dutext=${texts[${highlimits[$i]}]}
     59   fi
    4960
    50 for dir in ${dirs[@]}
    51 do
    5261   # check if directory is mounted (check if empty)
     62   printprocesslog "INFO check "$dir" with limit "$dutext"."
    5363   if [ "$(ls -A $dir)" ]
    5464   then
     
    6575   else
    6676      echo "ERROR "$dir" seems to be not mounted."
     77      printprocesslog "ERROR "$dir" seems to be not mounted."
    6778   fi
    6879done
    6980
     81finish
     82
Note: See TracChangeset for help on using the changeset viewer.