Fix Ceph plugins to suppport containerized collectd
- Install ceph-common package - In collectd container mount 1) /etc/ceph to /etc/ceph 2) /var/run/ceph/ to /var/run/ceph/ - Fix collect_ceph_storage.py Change-Id: Ifaf4537b86e7ad46da291920bba2933b04396ba9 Change-Id: I7f0bdd0446d1271bc2e10431a2974e0532612ea8
This commit is contained in:
parent
65543d7fdc
commit
2170a2e31e
@ -60,6 +60,15 @@
|
||||
version: master
|
||||
when: not (directory_exists.stat.isdir is defined and directory_exists.stat.isdir)
|
||||
|
||||
# CephStorage OSD monitoring
|
||||
# Only Monitors a single OSD on each CephStorage Node
|
||||
- name: Get 1st OSD socket
|
||||
shell: ls /var/run/ceph/ceph-osd.*.asok | head -n 1 | egrep -o '[0-9]+'
|
||||
register: cephstorage_osd_socket
|
||||
become: true
|
||||
when: "('CephStorage' in group_names and ceph_storage_collectd_plugin)"
|
||||
# End CephStorage OSD monitoring
|
||||
|
||||
- name: Create configuration directory
|
||||
file:
|
||||
path: "{{ browbeat_containers_path }}/collectd-openstack/config"
|
||||
@ -153,6 +162,11 @@
|
||||
-v /home/{{ host_remote_user }}/collectd_pipe:/collectd_pipe \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if config_type == 'controller' or config_type == 'cephstorage' %}
|
||||
{% if ceph_controller_collectd_plugin or ceph_storage_collectd_plugin %}
|
||||
-v /etc/ceph/:/etc/ceph/ -v /var/run/ceph/:/var/run/ceph/ \
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
collectd-openstack
|
||||
become: yes
|
||||
|
||||
|
@ -203,7 +203,7 @@ class CollectdCephStorage(object):
|
||||
json_data = json.loads(output)
|
||||
|
||||
pgs = {}
|
||||
for pg in json_data['pg_stats']:
|
||||
for pg in json_data['pg_map']['pg_stats']:
|
||||
for state in pg['state'].split('+'):
|
||||
if state not in pgs:
|
||||
pgs[state] = 0
|
||||
@ -213,7 +213,7 @@ class CollectdCephStorage(object):
|
||||
self.dispatch_value(
|
||||
'pg', state, pgs[state], self.ceph_pg_stats_interval)
|
||||
|
||||
for osd in json_data['osd_stats']:
|
||||
for osd in json_data['pg_map']['osd_stats']:
|
||||
osd_id = 'osd-{}'.format(osd['osd'])
|
||||
self.dispatch_value(
|
||||
osd_id, 'kb_used', osd['kb_used'],
|
||||
|
Loading…
Reference in New Issue
Block a user