-# Create monitoring data in table
-with open(dashboard_dir + 'posca_system_bandwidth\
-_terms_data.json') as terms_char:
- doc = json.load(terms_char)
-res = es.index(index=".kibana", doc_type="visualization",
- id="system_bandwidth_terms_data", body=doc)
-if res['created'] == "True":
- print("system_bandwidth_terms_data visualization has created")
-else:
- print("system_bandwidth_terms_data visualization has existed")
-
-# Create dashboard
-with open(dashboard_dir + 'posca_system_bandwidth\
-_dashboard.json') as dashboard:
- doc = json.load(dashboard)
-res = es.index(
- index=".kibana",
- doc_type="dashboard",
- id="system_bandwidth_dashboard",
- body=doc)
-if res['created'] == "True":
- print("system_bandwidth dashboard has created")
-else:
- print("system_bandwidth dashboard has existed")
+ # Create dashboard
+ with open(dashboard_dir + 'posca_system_bandwidth_dashboard.json')\
+ as dashboard:
+ doc = json.load(dashboard)
+ res = es.index(
+ index=".kibana",
+ doc_type="dashboard",
+ id="system_bandwidth_dashboard",
+ body=doc)
+ if res['created'] == "True":
+ LOG.info("system_bandwidth dashboard has created")
+ else:
+ LOG.info("system_bandwidth dashboard has existed")