Merge lp:~samuel-cozannet/orange-box/improved-status into lp:orange-box

Proposed by Samuel Cozannet
Status: Merged
Merged at revision: 500
Proposed branch: lp:~samuel-cozannet/orange-box/improved-status
Merge into: lp:orange-box
Diff against target: 28 lines (+7/-7)
1 file modified
usr/bin/orange-box-status-all-nodes (+7/-7)
To merge this branch: bzr merge lp:~samuel-cozannet/orange-box/improved-status
Reviewer Review Type Date Requested Status
Dustin Kirkland  Pending
Review via email: mp+237917@code.launchpad.net

Description of the change

Improving how the script queries the system to know if KVM nodes are up.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'usr/bin/orange-box-status-all-nodes'
--- usr/bin/orange-box-status-all-nodes 2014-10-02 13:12:21 +0000
+++ usr/bin/orange-box-status-all-nodes 2014-10-10 08:49:07 +0000
@@ -34,17 +34,17 @@
34status_all_nodes() {34status_all_nodes() {
35 # Check all VM nodes35 # Check all VM nodes
36 for i in $(seq 0 2); do36 for i in $(seq 0 2); do
37 if ps -ef | grep -qs "kvm.*node0vm${i}.maas" >/dev/null 2>&1; then37 if virsh list --all | grep node0vm${i} | grep running >/dev/null 2>&1; then
38 okay "[node0vm${i}]: Is running"38 okay "[node0vm${i}]: Is running"
39 uptime=$(ssh node0vm${i}.maas "uptime" 2>/dev/null)
40 if [ -n "$uptime" ]; then
41 okay "[node0vm${i}]: SSH to node successful; uptime=[$uptime]"
42 else
43 error "[node0vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
44 fi
39 else45 else
40 error "[node0vm${i}]: Is not running"46 error "[node0vm${i}]: Is not running"
41 fi47 fi
42 uptime=$(ssh node0vm${i}.maas "uptime" 2>/dev/null)
43 if [ -n "$uptime" ]; then
44 okay "[node0vm${i}]: SSH to node successful; uptime=[$uptime]"
45 else
46 error "[node0vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
47 fi
48 done48 done
49 # Check all AMT nodes49 # Check all AMT nodes
50 for i in $(seq 1 9); do50 for i in $(seq 1 9); do

Subscribers

People subscribed via source and target branches