File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
systemvm/debian/opt/cloud/bin Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1818
1919STATUS=UNKNOWN
2020
21+ get_guest_nics () {
22+ python3 -c "
23+ import json
24+ data = json.load(open('/etc/cloudstack/ips.json'))
25+ for nic, objs in data.items():
26+ if isinstance(objs, list):
27+ for obj in objs:
28+ if obj.get('nw_type') == 'guest' and obj.get('add'):
29+ print(nic)
30+ "
31+ }
32+
33+ ROUTER_TYPE=$( cat /etc/cloudstack/cmdline.json | grep type | awk ' {print $2;}' | sed -e ' s/[,\"]//g' )
34+ if [ " $ROUTER_TYPE " = " vpcrouter" ]; then
35+ GUEST_NICS=$( get_guest_nics)
36+ if [ " $GUEST_NICS " = " " ]; then
37+ echo " Status: ${STATUS} "
38+ exit
39+ fi
40+ fi
41+
2142if [ " $( systemctl is-active keepalived) " != " active" ]
2243then
2344 echo " Status: FAULT"
2445 exit
2546fi
2647
27- ROUTER_TYPE=$( cat /etc/cloudstack/cmdline.json | grep type | awk ' {print $2;}' | sed -e ' s/[,\"]//g' )
2848if [ " $ROUTER_TYPE " = " router" ]
2949then
3050 ROUTER_STATE=$( ip -4 addr show dev eth0 | grep inet | wc -l | xargs bash -c ' if [ $0 == 2 ]; then echo "PRIMARY"; else echo "BACKUP"; fi' )
You can’t perform that action at this time.
0 commit comments