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
1=== modified file 'usr/bin/orange-box-status-all-nodes'
2--- usr/bin/orange-box-status-all-nodes 2014-10-02 13:12:21 +0000
3+++ usr/bin/orange-box-status-all-nodes 2014-10-10 08:49:07 +0000
4@@ -34,17 +34,17 @@
5 status_all_nodes() {
6 # Check all VM nodes
7 for i in $(seq 0 2); do
8- if ps -ef | grep -qs "kvm.*node0vm${i}.maas" >/dev/null 2>&1; then
9+ if virsh list --all | grep node0vm${i} | grep running >/dev/null 2>&1; then
10 okay "[node0vm${i}]: Is running"
11+ uptime=$(ssh node0vm${i}.maas "uptime" 2>/dev/null)
12+ if [ -n "$uptime" ]; then
13+ okay "[node0vm${i}]: SSH to node successful; uptime=[$uptime]"
14+ else
15+ error "[node0vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
16+ fi
17 else
18 error "[node0vm${i}]: Is not running"
19 fi
20- uptime=$(ssh node0vm${i}.maas "uptime" 2>/dev/null)
21- if [ -n "$uptime" ]; then
22- okay "[node0vm${i}]: SSH to node successful; uptime=[$uptime]"
23- else
24- error "[node0vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
25- fi
26 done
27 # Check all AMT nodes
28 for i in $(seq 1 9); do

Subscribers

People subscribed via source and target branches