-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathqueue_check.sh
More file actions
39 lines (33 loc) · 765 Bytes
/
queue_check.sh
File metadata and controls
39 lines (33 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
#
# Check message queues against hypervisors
# Put current rabbit queues in array
#declare -a queue_array
#for i in $(rabbitmqctl list_queues | awk '{print $1}' | tail -n+1 );
#do
# queue_array=$(("${queue_array[@]}" "$i"))
#done
queues=$(rabbitmqctl list_queues | awk '{print $1}')
# Put current nova services in array
declare -a service_array
for i in $(nova service-list | awk -F\| '/compute/ {print $4}' | cut -d\ -f2);
do
service_array=( "${service_array[@]}" "$i" )
done
# debug
#echo "${queue_array[@]}"
#echo
#echo $queues
#echo "${service_array[@]}"
# Compare
count=0
for i in ${service_array[@]};
do
echo $queues | grep $i &> /dev/null
if [ $? -ne 0 ];
then
echo $i
count=$((count + 1))
fi
done
echo $count