diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2011-09-18 12:02:49 +0200 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2011-09-18 12:02:49 +0200 |
commit | 34527a0ada33fde2b3fafc0d76b8dbb3772ad109 (patch) | |
tree | 52f3a5e87d8b2462faf63b92c84fe535e4e0c060 | |
parent | b5e6be27551e79730b2adf6903b9fa925451f7db (diff) |
fix status for single vm
-rwxr-xr-x | kvm-wrapper.sh | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh index 04afb7b..491b9a6 100755 --- a/kvm-wrapper.sh +++ b/kvm-wrapper.sh @@ -367,7 +367,7 @@ function monitor_send_sysrq () function kvm_status_from_pid { local VM_PID=$@ - test_nodename "$NODE" && run_remote $NODE ps wwp "$VM_PID" || ps wwp "$VM_PID" + test_nodename "$KVM_CLUSTER_NODE" && run_remote "$KVM_CLUSTER_NODE" ps wwp "$VM_PID" || ps wwp "$VM_PID" } function kvm_status_vm () @@ -384,10 +384,10 @@ function kvm_status () then kvm_status_vm "$1" else - for NODE in `ls -1 $PID_DIR/*-vm.pid|cut -d: -f1|sed -e 's:.*/::'|uniq` + for KVM_CLUSTER_NODE in `ls -1 $PID_DIR/*-vm.pid|cut -d: -f1|sed -e 's:.*/::'|uniq` do - echo "servers on $NODE:" - kvm_status_from_pid `cat $PID_DIR/$NODE\:*-vm.pid` + echo "servers on $KVM_CLUSTER_NODE:" + kvm_status_from_pid `cat $PID_DIR/$KVM_CLUSTER_NODE\:*-vm.pid` done fi } @@ -864,7 +864,9 @@ case "$1" in exit 0 ;; status) - kvm_status "all" + if [[ -n "$2" ]]; then + kvm_status "$2" + else kvm_status "all"; fi exit 0 ;; rundisk) @@ -993,9 +995,6 @@ case "$1" in kvm_monitor "$2" else print_help; fi ;; - status) - kvm_status "$2" - ;; serial) if [[ $# -eq 2 ]]; then kvm_serial "$2" |