Added ceph plugin and other fixes

This change adds the configuration for the ceph plugin, a plugin
to monitor an ceph cluster.

Also, fixes:
  - host alive, http and process plugins
  - the agent configuration

Also, moved the dashboards to the grafana role, where they are
already being imported to grafana.

Change-Id: I70b10630c9181f293fc9dbe268029b251fad7823
This commit is contained in:
Flávio Ramalho 2017-08-03 05:57:32 -03:00
parent 6219b6dbd4
commit 2ca872d988
15 changed files with 44 additions and 10653 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -47,6 +47,7 @@ monasca_agent_system_user_home: "/var/lib/{{ monasca_agent_system_user_name }}"
# Monasca-agent configuration # Monasca-agent configuration
monasca_agent_user_name: monasca-agent monasca_agent_user_name: monasca-agent
monasca_agent_project_name: admin monasca_agent_project_name: admin
monasca_service_region: RegionOne
monasca_agent_check_frequency: 15 monasca_agent_check_frequency: 15
monasca_agent_log_level: WARN monasca_agent_log_level: WARN
@ -221,6 +222,7 @@ monasca_agent_os_processes_to_monitor:
- name: cinder-scheduler - name: cinder-scheduler
- name: cinder-volume - name: cinder-volume
- name: cinder-backup - name: cinder-backup
enabled: "{{ cinder_service_backup_program_enabled | default(False) }}"
haproxy_ssl: True haproxy_ssl: True
galera_monitoring_user: "monitoring" galera_monitoring_user: "monitoring"
@ -230,6 +232,8 @@ monasca_agent_plugins_http_check_disabled:
- nova_console - nova_console
monasca_agent_plugins: monasca_agent_plugins:
- name: "ceph"
where: "ceph-mon"
- name: "cpu" - name: "cpu"
where: "all" where: "all"
- name: "disk" - name: "disk"

View File

@ -34,6 +34,7 @@ Plugins
By default the monasca-agent role configures the following plugins: By default the monasca-agent role configures the following plugins:
- apache - apache
- ceph
- cpu - cpu
- crash - crash
- disk - disk
@ -58,12 +59,3 @@ More information about the available plugins, its configuration
and metric details is available at the `monasca-agent repository`_. and metric details is available at the `monasca-agent repository`_.
.. _monasca-agent repository: https://github.com/openstack/monasca-agent/blob/master/docs/Plugins.md .. _monasca-agent repository: https://github.com/openstack/monasca-agent/blob/master/docs/Plugins.md
Dashboards
~~~~~~~~~~
Sample grafana dashboards for visualization of some metrics collected
by the configured plugins are also available at the
`monasca-agent role repository`_.
.. _monasca-agent role repository: https://github.com/openstack/openstack-ansible-os_monasca-agent/tree/master/dashboards

View File

@ -12,7 +12,7 @@
# limitations under the License. # limitations under the License.
monasca_agent_venv_tag: "{{ venv_tag }}" monasca_agent_venv_tag: "{{ venv_tag }}"
monasca_agent_venv_download_url: "{{ venv_base_download_url }}/monasca_agent-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz" monasca_agent_venv_download_url: "{{ venv_base_download_url }}/monasca-agent-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz"
monasca_service_port: 8070 monasca_service_port: 8070
monasca_service_proto: http monasca_service_proto: http

View File

@ -40,8 +40,6 @@
- crontab - crontab
vars: vars:
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"
vars_files:
- vars/configs/haproxy_config.yml
tags: tags:
- monasca - monasca

View File

@ -57,6 +57,19 @@
notify: notify:
- Restart monasca-agent services - Restart monasca-agent services
- name: Add monasca-agent user to ceph group
user:
name: "monasca-agent"
groups: "ceph"
append: yes
when: inventory_hostname in groups['ceph-mon'] | default([])
- name: Add read permission on ceph key to group
file:
path: "/etc/ceph/ceph.client.admin.keyring"
mode: 0640
when: inventory_hostname in groups['ceph-mon'] | default([])
- name: Allow monasca user to have passwordless find - name: Allow monasca user to have passwordless find
lineinfile: lineinfile:
dest: /etc/sudoers dest: /etc/sudoers

View File

@ -11,14 +11,14 @@ Api:
max_measurement_buffer_size: -1 max_measurement_buffer_size: -1
password: {{ monasca_agent_password }} password: {{ monasca_agent_password }}
project_domain_id: null project_domain_id: null
project_domain_name: null project_domain_name: {{ monasca_service_domain_name | default("Default") }}
project_id: null project_id: null
project_name: {{ monasca_agent_project_name }} project_name: {{ monasca_agent_project_name }}
region_name: null region_name: {{ monasca_service_region }}
service_type: null service_type: monitoring
url: {{ monasca_service_adminurl }} url: {{ monasca_service_adminurl }}
user_domain_id: null user_domain_id: null
user_domain_name: null user_domain_name: {{ monasca_service_domain_name | default("Default") }}
username: {{ monasca_agent_user_name }} username: {{ monasca_agent_user_name }}
Logging: Logging:
collector_log_file: /var/log/monasca/agent/collector.log collector_log_file: /var/log/monasca/agent/collector.log

View File

@ -0,0 +1,11 @@
# {{ ansible_managed }}
init_config: null
instances:
- cluster_name: ceph
collect_usage_metrics: True
collect_stats_metrics: True
collect_mon_metrics: True
collect_osd_metrics: True
collect_pool_metrics: True

View File

@ -5,8 +5,8 @@ init_config: null
instances: instances:
{% for host in groups['all'] %} {% for host in groups['all'] %}
- name: {{ ansible_hostname }} - name: {{ host }}
host_name: {{ ansible_hostname }} host_name: {{ host }}
alive_test: ssh alive_test: ssh
dimensions: dimensions:
{% if host in groups['all_containers'] %} {% if host in groups['all_containers'] %}

View File

@ -13,7 +13,7 @@ instances:
{% else %} {% else %}
{% set _merge = monasca_agent_os_processes_to_monitor.update(monasca_agent_infra_processes_to_monitor) %} {% set _merge = monasca_agent_os_processes_to_monitor.update(monasca_agent_infra_processes_to_monitor) %}
{% set found = False %} {% set found = False %}
{% for service, processes in monasca_agent_os_processes_to_monitor.iteritems() if not found %} {% for service, processes in monasca_agent_os_processes_to_monitor.items() if not found %}
{% for p in processes %} {% for p in processes %}
{% if service_name.value in p.name %} {% if service_name.value in p.name %}
{% set found = service_name.update({'value': service}) %} {% set found = service_name.update({'value': service}) %}
@ -37,6 +37,7 @@ instances:
collect_response_time: true collect_response_time: true
url: {{ proto }}://{% if item.service.haproxy_bind is defined %}{{ item.service.haproxy_bind.0 }}{% else %}{{ external_lb_vip_address }}{% endif %}:{{ item.service.haproxy_port }}{{path | default('') }} url: {{ proto }}://{% if item.service.haproxy_bind is defined %}{{ item.service.haproxy_bind.0 }}{% else %}{{ external_lb_vip_address }}{% endif %}:{{ item.service.haproxy_port }}{{path | default('') }}
use_keystone: {% if item.service.haproxy_service_name == 'monasca_api' %}yes{% else %}no{% endif %} use_keystone: {% if item.service.haproxy_service_name == 'monasca_api' %}yes{% else %}no{% endif %}
dimensions: dimensions:
service: {{ service_name.value }} service: {{ service_name.value }}
component: {{ item.service.haproxy_service_name | replace('_', '-') }} component: {{ item.service.haproxy_service_name | replace('_', '-') }}

View File

@ -11,7 +11,7 @@ instances:
component: monasca-agent component: monasca-agent
service: monitoring service: monitoring
{% for service, processes in monasca_agent_os_processes_to_monitor.iteritems() %} {% for service, processes in monasca_agent_os_processes_to_monitor.items() %}
{% for item in processes %} {% for item in processes %}
{% if item.enabled | default(True) and inventory_hostname in groups[item.group|default(item.name|replace('-', '_'))] | default([]) %} {% if item.enabled | default(True) and inventory_hostname in groups[item.group|default(item.name|replace('-', '_'))] | default([]) %}
- name: {{ item.name }} - name: {{ item.name }}
@ -26,7 +26,7 @@ instances:
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% for service, processes in monasca_agent_infra_processes_to_monitor.iteritems() %} {% for service, processes in monasca_agent_infra_processes_to_monitor.items() %}
{% for item in processes %} {% for item in processes %}
{% if item.enabled | default(True) and inventory_hostname in groups[item.group|default(item.name|replace('-', '_'))] | default([]) %} {% if item.enabled | default(True) and inventory_hostname in groups[item.group|default(item.name|replace('-', '_'))] | default([]) %}
- name: {{ item.name }} - name: {{ item.name }}

View File

@ -6,7 +6,10 @@
-s 'monitoring' \ -s 'monitoring' \
--keystone_url '{{ keystone_service_adminurl }}' \ --keystone_url '{{ keystone_service_adminurl }}' \
--project_name '{{ monasca_agent_project_name }}' \ --project_name '{{ monasca_agent_project_name }}' \
--monasca_url '{{ monasca_service_adminurl }}' \ --project_domain_name '{{ monasca_service_domain_name | default("Default") }}' \
--user_domain_name '{{ monasca_service_domain_name | default("Default") }}' \
--endpoint_type 'internal' \
--region_name '{{ monasca_service_region }}' \
--check_frequency '{{ monasca_agent_check_frequency }}' \ --check_frequency '{{ monasca_agent_check_frequency }}' \
--log_level '{{ monasca_agent_log_level }}' \ --log_level '{{ monasca_agent_log_level }}' \
--user '{{ monasca_agent_system_user_name }}' \ --user '{{ monasca_agent_system_user_name }}' \