-
Notifications
You must be signed in to change notification settings - Fork 9
/
report-services-down.sh
executable file
·37 lines (29 loc) · 1.08 KB
/
report-services-down.sh
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
#!/bin/bash
#
# Report on services that are down and still enabled
#
# Author: Steven Nemetz
email='[email protected]'
dir_tmp='/tmp'
down_cinder="${dir_tmp}/down-service-cinder"
down_nova="${dir_tmp}/down-service-nova"
cinder_services_down=$(cinder service-list | grep down | grep enabled | tee $down_cinder | wc -l )
nova_services_down=$(nova service-list | grep down | grep enabled | tee $down_nova | wc -l)
echo "Cinder services down: $cinder_services_down"
echo "Nova services down: $nova_services_down"
if [ $cinder_services_down -ne 0 -o $nova_services_down -ne 0 ]; then
#mail -s "OpenStack Report: Eng Services Down" $email <<MSG
cat << MSG
OpenStack Cinder & Nova Services Report
If all 3 services are down on a host, most likely the system crashed.
Disable the services. Then find the IPMI to verify and reboot
If 1 or 2 services are down on a host
Restart the services and see if the log says anything useful.
Cinder Issues: $cinder_services_down
$(cat $down_cinder)
Nova Issues: $nova_services_down
$(cat $down_nova)
MSG
fi
rm -f $down_cinder $down_nova