Index: drbl-virt/sbin/check_drbl_VM
===================================================================
--- drbl-virt/sbin/check_drbl_XenVM	(revision 219)
+++ drbl-virt/sbin/check_drbl_VM	(revision 222)
@@ -17,53 +17,64 @@
 drbl_vm_file="/tmp/drbl_vm_status.$$"
 drbl_vm_xentop_file="/tmp/drbl_vm_xentop.$$"
+# check Xen or KVM
+hypervisior=$(cat $Work_Home/etc/hypervisior)
+
 
 # [Main] 
 check_root
-for client_IP in $client_IPs
-do
-    # local variables
-    IP_status="online"
-    client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | grep $client_IP | awk '{print $2}')"
-    vm_numbers=""
-    vm_hostnames=""
-    vm_IP=""
-    vm_CPU_core=""
-    vm_Ram=""
-    vm_CPU_loading=""
-    vm_Ram_loading=""
-    # check network status
-    ping -c1 -w1 $client_IP > /dev/null 2>&1 || IP_status="offline"
+
+case $hypervisior in
+    "Xen")
+    for client_IP in $client_IPs
+    do
+        # local variables
+        IP_status="online"
+        client_hostname="$(cat $Work_Home/etc/IP_HOST_TABLE | grep -v "#" | grep $client_IP | awk '{print $2}')"
+        vm_numbers=""
+        vm_hostnames=""
+        vm_IP=""
+        vm_CPU_core=""
+        vm_Ram=""
+        vm_CPU_loading=""
+        vm_Ram_loading=""
+        # check network status
+        ping -c1 -w1 $client_IP > /dev/null 2>&1 || IP_status="offline"
     
-    if [ $IP_status == "online" ]; then
-        ssh -o StrictHostKeyChecking=no $client_IP "xentop -d1 -b -i2 | awk '/^.*NAME/{i++}i==2'" > $drbl_vm_xentop_file
-        vm_hostnames="$(cat $drbl_vm_xentop_file | sed -n '3,$p' | awk '{print $1}')"
+        if [ $IP_status == "online" ]; then
+            ssh -o StrictHostKeyChecking=no $client_IP "xentop -d1 -b -i2 | awk '/^.*NAME/{i++}i==2'" > $drbl_vm_xentop_file
+            vm_hostnames="$(cat $drbl_vm_xentop_file | sed -n '3,$p' | awk '{print $1}')"
     
-#        printf "[$client_hostname] " >> $drbl_vm_file
-        printf "[$client_hostname] "
-        declare -i i=1
+            # printf "[$client_hostname] " >> $drbl_vm_file
+            printf "[$client_hostname] "
+            declare -i i=1
 
-        vm_numbers=$(echo $vm_hostnames | wc -w)
+            vm_numbers=$(echo $vm_hostnames | wc -w)
 
-#        printf "[Running VM: $vm_numbers]\n" >> $drbl_vm_file
-        printf "[Running VM: $vm_numbers]\n"
+           # printf "[Running VM: $vm_numbers]\n" >> $drbl_vm_file
+            printf "[Running VM: $vm_numbers]\n"
 
-        for vm_hostname in $vm_hostnames
-        do  
-            vm_CPU_core="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $9}')"
-            vm_Ram="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $5}')"
-            vm_CPU_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $4}')"
-            vm_Ram_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $6}')"
-#            printf "VM$i: $vm_hostname $vm_CPU_core ${vm_Ram}K $vm_CPU_loading%% $vm_Ram_loading%%\n" >> $drbl_vm_file
-            printf "VM$i: $vm_hostname VCPU=$vm_CPU_core Mem=${vm_Ram}K VCPU_loading=$vm_CPU_loading%% Mem_usage=$vm_Ram_loading%%\n"
-            i=i+1
-        done
-        echo "" 
-    else
-        echo "[Error] $client_hostname $client_IP is offline !"
+            for vm_hostname in $vm_hostnames
+            do  
+                vm_CPU_core="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $9}')"
+                vm_Ram="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $5}')"
+                vm_CPU_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $4}')"
+                vm_Ram_loading="$(cat $drbl_vm_xentop_file | grep $vm_hostname | awk '{print $6}')"
+               # printf "VM$i: $vm_hostname $vm_CPU_core ${vm_Ram}K $vm_CPU_loading%% $vm_Ram_loading%%\n" >> $drbl_vm_file
+                printf "VM$i: $vm_hostname VCPU=$vm_CPU_core Mem=${vm_Ram}K VCPU_loading=$vm_CPU_loading%% Mem_usage=$vm_Ram_loading%%\n"
+                i=i+1
+            done
+            echo "" 
+        else
+            echo "[Error] $client_hostname $client_IP is offline !"
 
-    fi
+        fi
 
-done
+    done
+    ;;
 
+    "KVM")
+        echo "KVM"
+    ;;
+esac
 # dlete tmp file
 rm -f $drbl_vm_xentop_file
