Merge "alerts definition for ceph mgr prometheus plugin target definition for ceph exporter" into release/2019.2.0
diff --git a/ceph/meta/fluentd.yml b/ceph/meta/fluentd.yml
new file mode 100644
index 0000000..8bc2794
--- /dev/null
+++ b/ceph/meta/fluentd.yml
@@ -0,0 +1,79 @@
+{%- if pillar.get('fluentd', {}).get('agent', {}).get('enabled', False) %}
+{%- set positiondb = pillar.fluentd.agent.dir.positiondb %}
+agent:
+ config:
+ label:
+ ceph:
+ input:
+ tail_ceph-osd:
+ type: tail
+ tag: ceph.osd
+ path: /var/log/ceph/ceph-osd*
+ path_key: log_location
+ pos_file: {{ positiondb }}/ceph.osd.pos
+ parser:
+ type: regexp
+ time_key: Timestamp
+ time_format: '%Y-%m-%d %H:%M:%S.%N'
+ keep_time_key: false
+ format: >-
+ '/^(?<Timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{6}) (?<Payload>.*)/'
+ tail_ceph-mon:
+ type: tail
+ tag: ceph.mon
+ path: /var/log/ceph/ceph-mon*, /var/log/ceph/ceph.log, /var/log/ceph/ceph.audit.log
+ path_key: log_location
+ pos_file: {{ positiondb }}/ceph.mon.pos
+ parser:
+ type: regexp
+ time_key: Timestamp
+ time_format: '%Y-%m-%d %H:%M:%S.%N'
+ keep_time_key: false
+ format: >-
+ '/^(?<Timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{6}) (?<Payload>.*)/'
+ tail_ceph-mgr:
+ type: tail
+ tag: ceph.mgr
+ path: /var/log/ceph/ceph-mgr*
+ path_key: log_location
+ pos_file: {{ positiondb }}/ceph.mgr.pos
+ parser:
+ type: regexp
+ time_key: Timestamp
+ time_format: '%Y-%m-%d %H:%M:%S.%N'
+ keep_time_key: false
+ format: >-
+ '/^(?<Timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{6}) (?<Payload>.*)/'
+ tail_radosgw:
+ type: tail
+ tag: ceph.radosgw
+ path: /var/log/ceph/ceph-rgw*
+ path_key: log_location
+ pos_file: {{ positiondb }}/ceph.radosgw.pos
+ parser:
+ type: regexp
+ time_key: Timestamp
+ time_format: '%Y-%m-%d %H:%M:%S.%N'
+ keep_time_key: false
+ format: >-
+ '/^(?<Timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{6}) (?<Payload>.*)$/'
+
+ filter:
+ match_severity:
+ type: record_transformer
+ tag: ceph.**
+ enable_ruby: true
+ record:
+ - name: programname
+ value: ceph
+ - name: severity_label
+ value: INFO
+ - name: Severity
+ value: 6
+ match:
+ push_to_default:
+ tag: ceph.*
+ type: relabel
+ label: default_output
+
+{%- endif %}
diff --git a/ceph/mgr.sls b/ceph/mgr.sls
index bfc58b1..cda9856 100644
--- a/ceph/mgr.sls
+++ b/ceph/mgr.sls
@@ -83,7 +83,19 @@
disable_ceph_dashboard:
cmd.run:
- name: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module disable dashboard"
- - onlyif: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module ls | grep dashboard"
+ - unless: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module ls | grep dashboard"
+ - require:
+ - file: common_config
+ - file: /var/lib/ceph/mgr/{{ common.get('cluster_name', 'ceph') }}-{{ grains.host }}/
+
+{%- endif %}
+
+{%- if pillar.get('prometheus', {}).get('collector',{}).get("enabled", False) %}
+
+enable_prometheus_plugin:
+ cmd.run:
+ - name: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module enable prometheus"
+ - unless: "ceph -c /etc/ceph/{{ common.get('cluster_name', 'ceph') }}.conf mgr module ls | grep prometheus"
- require:
- file: common_config
- file: /var/lib/ceph/mgr/{{ common.get('cluster_name', 'ceph') }}-{{ grains.host }}/
@@ -92,4 +104,4 @@
{%- endif %}
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index 2be3736..5c87d50 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -15,3 +15,5 @@
enabled: true
grafana:
enabled: true
+ fluentd:
+ enabled: true