Changeset 18857 for trunk/DataCheck/Monitoring
- Timestamp:
- 05/14/17 21:01:41 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DataCheck/Monitoring/CheckDU.sh
r17617 r18857 8 8 9 9 # 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 10 limits=( 10485760 52428800 104857600 209715200 524288000 1073741824 2147483648 ) 11 texts=( "10 GB" "50 GB" "100 GB" "200 GB" "500 GB" "1 TB" "2 TB" ) 16 12 17 13 # get paths depending on host … … 19 15 # data) dirs=( "/loc_data" "/daq" "/newdaq" ) 20 16 data) dirs=( "/loc_data" ) 17 lowlimits=( 4 ) 18 highlimits=( 5 ) 21 19 ;; 22 20 daq) dirs=( "/raid10" ) 21 lowlimits=( 4 ) 22 highlimits=( 5 ) 23 23 ;; 24 24 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 ) 25 33 ;; 26 34 isdc-dl00) dirs=( "/gpfs" "/scratch" ) 27 highlimit=128 # better: array of limits35 lowlimits=( 4 ) 36 highlimits=( 4 ) 29 37 ;; 30 38 *) echo "no valid host "$HOSTNAME … … 36 44 hour=`date +%k` 37 45 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 46 for (( i=0 ; i< ${#dirs[@]} ; i++ )) 47 do 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 49 60 50 for dir in ${dirs[@]}51 do52 61 # check if directory is mounted (check if empty) 62 printprocesslog "INFO check "$dir" with limit "$dutext"." 53 63 if [ "$(ls -A $dir)" ] 54 64 then … … 65 75 else 66 76 echo "ERROR "$dir" seems to be not mounted." 77 printprocesslog "ERROR "$dir" seems to be not mounted." 67 78 fi 68 79 done 69 80 81 finish 82
Note:
See TracChangeset
for help on using the changeset viewer.