Ignore:
Timestamp:
Aug 31, 2010, 4:14:38 PM (15 years ago)
Author:
rock
Message:

Bugfix: correct path & delete unused sh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • drbl-virt/sbin/check_drbl_client.sh

    r202 r204  
    3737        client_CPU_core=$(ssh -o StrictHostKeyChecking=no $client_IP "cat /proc/cpuinfo |grep processor | wc -l")
    3838        # check top information
    39         ssh -o StrictHostKeyChecking=no $client_IP "top -b -n1" > $drbl_client_top_file
     39        ssh -o StrictHostKeyChecking=no $client_IP "top -b -n2 -d1 | awk '/^top/{i++}i==2'" > $drbl_client_top_file
     40IP_VM_right_line=""
    4041        client_idle_CPU=$(cat $drbl_client_top_file | grep ^Cpu | sed 's/^.*ni,//' | sed 's/id,.*$//'  | awk '{print $1}')
    4142        client_Ram=$(cat $drbl_client_top_file | grep ^Mem | sed 's/total.*$//' | sed 's/^Mem://' | awk '{print $1}')
     
    4546
    4647echo "[$client_hostname $client_IP] $IP_status CPU_Core=$client_CPU_core Ram=$client_Ram idle_CPU=$client_idle_CPU unused_Ram=$client_unused_Ram"
    47 echo "[$client_hostname $client_IP] $IP_status $client_CPU_core $client_Ram $client_idle_CPU $client_unused_Ram" >> $drbl_client_file
     48#echo "[$client_hostname $client_IP] $IP_status $client_CPU_core $client_Ram $client_idle_CPU $client_unused_Ram" >> $drbl_client_file
    4849
    4950done
Note: See TracChangeset for help on using the changeset viewer.