FIX for supporting metrics from ONOS controller
Change-Id: I21a1656ebed6593680ecf873a69eab85e7408461
diff --git a/xos/synchronizer/ceilometer/monitoring_agent/ceilometer-plugins b/xos/synchronizer/ceilometer/monitoring_agent/ceilometer-plugins
new file mode 120000
index 0000000..0b52d17
--- /dev/null
+++ b/xos/synchronizer/ceilometer/monitoring_agent/ceilometer-plugins
@@ -0,0 +1 @@
+../ceilometer-plugins/
\ No newline at end of file
diff --git a/xos/synchronizer/ceilometer/monitoring_agent/ceilometer_config.yaml b/xos/synchronizer/ceilometer/monitoring_agent/ceilometer_config.yaml
index 9d36bcb..95fca98 100644
--- a/xos/synchronizer/ceilometer/monitoring_agent/ceilometer_config.yaml
+++ b/xos/synchronizer/ceilometer/monitoring_agent/ceilometer_config.yaml
@@ -31,6 +31,18 @@
- name: make sure /usr/local/share/monitoring_agent exists
file: path=/usr/local/share/monitoring_agent state=directory owner=root group=root
+ - name: Copying ONOS driver files
+ when : "'ceilometer' in instance_name"
+ copy: src=ceilometer-plugins/network/statistics/ dest=/usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
+
+ - name: Enabling ONOS driver in /usr/lib/python2.7/dist-packages/ceilometer-2015.1.4.egg-info/entry_points.txt
+ when : "'ceilometer' in instance_name"
+ lineinfile:
+ dest: /usr/lib/python2.7/dist-packages/ceilometer-2015.1.4.egg-info/entry_points.txt
+ insertafter: '^\[network\.statistics\.drivers\]'
+ line: "onos = ceilometer.network.statistics.onos.driver:ONOSDriver"
+ state: present
+
- name: Copying monitoring agent conf file
when : "'ceilometer' in instance_name"
set_fact: ceilometer_services="ceilometer-agent-central,ceilometer-agent-notification,ceilometer-collector,ceilometer-api"
diff --git a/xos/synchronizer/ceilometer/monitoring_agent/monitoring_agent.py b/xos/synchronizer/ceilometer/monitoring_agent/monitoring_agent.py
index 5128d50..539f091 100644
--- a/xos/synchronizer/ceilometer/monitoring_agent/monitoring_agent.py
+++ b/xos/synchronizer/ceilometer/monitoring_agent/monitoring_agent.py
@@ -33,10 +33,7 @@
try:
target = request.json['target']
logging.debug("target:%s",target)
- metadata = request.json['meta_data']
- logging.debug("metadata:%s",metadata)
- logging.debug(type(target))
- resources = metadata['resources']
+ resources = request.json['resources']
logging.debug("resources:%s",resources)
if not generate_pipeline.openstack_service_info:
logging.debug("Openstak Service is not enabled,Only ONOS need to be enabled")
diff --git a/xos/synchronizer/steps/sync_openstackmonitoringpublisher.py b/xos/synchronizer/steps/sync_openstackmonitoringpublisher.py
index 5622657..dd4db20 100644
--- a/xos/synchronizer/steps/sync_openstackmonitoringpublisher.py
+++ b/xos/synchronizer/steps/sync_openstackmonitoringpublisher.py
@@ -99,7 +99,7 @@
body = {'target': target_uri}
if agent.start_url_json_data:
start_url_dict = json.loads(agent.start_url_json_data)
- body.update(agent.start_url_dict)
+ body.update(start_url_dict)
a = {'url': agent.start_url, 'body': json.dumps(body)}
agent_info.append(a)