blob: 0aea3fb9ea1e8fc3f5ae840d4a5dfa1b2c1639b6 [file] [log] [blame]
Brian Freeman81f6e9e2018-11-11 22:36:20 -05001#! /usr/bin/python
2
3import logging
4import json
5from vcpecommon import *
6import commands
7import sys
8
9if len(sys.argv) <2:
10 print('namespace not provided')
11 print('Usage: healthcheck-k8s.py onap')
12 sys.exit()
13
14namespace=sys.argv[1]
15
16logging.basicConfig(level=logging.INFO, format='%(message)s')
17common = VcpeCommon()
18
19print('Checking vGMUX REST API from SDNC')
20cmd = 'curl -u admin:admin -X GET http://10.0.101.21:8183/restconf/config/ietf-interfaces:interfaces'
21ret = commands.getstatusoutput("kubectl -n {0} exec dev-sdnc-sdnc-0 -- bash -c '{1}'".format(namespace,cmd))
22sz = ret[-1].split('\n')[-1]
23print('\n')
24print(sz)
25
26print('Checking vBRG REST API from SDNC')
27cmd = 'curl -u admin:admin -X GET http://10.3.0.2:8183/restconf/config/ietf-interfaces:interfaces'
28ret = commands.getstatusoutput("kubectl -n {0} exec dev-sdnc-sdnc-0 -- bash -c '{1}'".format(namespace,cmd))
29sz = ret[-1].split('\n')[-1]
30print('\n')
31print(sz)
32
33print('Checking SDNC DB for vBRG MAC address')
34mac = common.get_brg_mac_from_sdnc()
35print(mac)
36