diff --git a/ansible/install/group_vars/all.yml b/ansible/install/group_vars/all.yml index 66225da83..d934e4eb7 100644 --- a/ansible/install/group_vars/all.yml +++ b/ansible/install/group_vars/all.yml @@ -74,6 +74,16 @@ collectd_cephstorage: true collectd_compute: false # Collect plugins configuration: +######################## +# Apache plugin +######################## +# Undercloud +apache_undercloud_collectd_plugin: false +apache_undercloud_mod_status_port: 5001 +# Overcloud Controller +apache_controller_collectd_plugin: false +apache_controller_mod_status_port: 5001 + ######################## # Gnocchi backlog plugin ######################## diff --git a/ansible/install/roles/collectd-openstack/tasks/main.yml b/ansible/install/roles/collectd-openstack/tasks/main.yml index 21933027f..6b59e7fae 100644 --- a/ansible/install/roles/collectd-openstack/tasks/main.yml +++ b/ansible/install/roles/collectd-openstack/tasks/main.yml @@ -12,8 +12,9 @@ become: true with_items: - collectd - - collectd-turbostat + - collectd-apache - collectd-mysql + - collectd-turbostat # Get mysql's root password - name: (Controllers Only) Get mysql root password @@ -38,6 +39,35 @@ with_items: "{{overcloudrc_file.stdout_lines | default(omit)}}" when: "(gnocchi_status_python_plugin == true) and (inventory_hostname == groups['controller'][0])" +# Apache Monitoring +- name: Deploy Apache mod_status conf + template: + src: 00-browbeat_mod_status.conf.j2 + dest: /etc/httpd/conf.d/00-browbeat_mod_status.conf + owner: root + group: root + become: true + when: "(('controller' in group_names and {{apache_controller_collectd_plugin}} == true) or ('undercloud' in group_names and {{apache_undercloud_collectd_plugin}} == true))" + +- name: (Undercloud Only) Allow httpd to listen to port ({{apache_undercloud_mod_status_port}}) + shell: "/usr/sbin/semanage port -m -t http_port_t -p tcp {{apache_undercloud_mod_status_port}}" + become: true + when: "('undercloud' in group_names and {{apache_undercloud_collectd_plugin}} == true)" + +- name: (Controller Only) Allow httpd to listen to port ({{apache_controller_mod_status_port}}) + shell: "/usr/sbin/semanage port -m -t http_port_t -p tcp {{apache_controller_mod_status_port}}" + become: true + when: "('controller' in group_names and {{apache_controller_collectd_plugin}} == true)" + +- name: Restart Apache + service: + name: httpd + state: restarted + enabled: true + become: true + when: "(('controller' in group_names and {{apache_controller_collectd_plugin}} == true) or ('undercloud' in group_names and {{apache_undercloud_collectd_plugin}} == true))" +# End Apache Monitoring + - name: Reload systemd units command: systemctl daemon-reload become: true diff --git a/ansible/install/roles/collectd-openstack/templates/00-browbeat_mod_status.conf.j2 b/ansible/install/roles/collectd-openstack/templates/00-browbeat_mod_status.conf.j2 new file mode 100644 index 000000000..dfd0e15f3 --- /dev/null +++ b/ansible/install/roles/collectd-openstack/templates/00-browbeat_mod_status.conf.j2 @@ -0,0 +1,25 @@ +# Installed by Browbeat Ansible Installer + +{% if 'undercloud' in group_names %} +LoadModule status_module modules/mod_status.so + +Listen {{apache_undercloud_mod_status_port}} +{% endif %} +{% if 'controller' in group_names %} +Listen {{apache_controller_mod_status_port}} +{% endif %} + +ExtendedStatus on +{% if 'undercloud' in group_names %} + +{% endif %} +{% if 'controller' in group_names %} + +{% endif %} + + SetHandler server-status + Order deny,allow + Deny from all + Allow from 127.0.0.1 + + diff --git a/ansible/install/roles/collectd-openstack/templates/controller.collectd.conf.j2 b/ansible/install/roles/collectd-openstack/templates/controller.collectd.conf.j2 index e26df9991..67c11fcb8 100644 --- a/ansible/install/roles/collectd-openstack/templates/controller.collectd.conf.j2 +++ b/ansible/install/roles/collectd-openstack/templates/controller.collectd.conf.j2 @@ -16,6 +16,9 @@ LoadPlugin "logfile" LoadPlugin write_graphite +{% if apache_controller_collectd_plugin %} +LoadPlugin apache +{% endif %} LoadPlugin cpu LoadPlugin conntrack LoadPlugin df @@ -76,6 +79,13 @@ PreCacheChain "PreCache" +{% if apache_controller_collectd_plugin %} + + + URL "http://127.0.0.1:{{apache_controller_mod_status_port}}/mod_status?auto" + + +{% endif %} ValuesPercentage true diff --git a/ansible/install/roles/collectd-openstack/templates/undercloud.collectd.conf.j2 b/ansible/install/roles/collectd-openstack/templates/undercloud.collectd.conf.j2 index 048091aec..320be18a0 100644 --- a/ansible/install/roles/collectd-openstack/templates/undercloud.collectd.conf.j2 +++ b/ansible/install/roles/collectd-openstack/templates/undercloud.collectd.conf.j2 @@ -16,6 +16,9 @@ LoadPlugin "logfile" LoadPlugin write_graphite +{% if apache_undercloud_collectd_plugin %} +LoadPlugin apache +{% endif %} LoadPlugin cpu LoadPlugin conntrack LoadPlugin df @@ -76,6 +79,13 @@ PreCacheChain "PreCache" +{% if apache_undercloud_collectd_plugin %} + + + URL "http://127.0.0.1:{{apache_undercloud_mod_status_port}}/mod_status?auto" + + +{% endif %} ValuesPercentage true diff --git a/ansible/install/roles/grafana-dashboards/templates/openstack_general_system_performance.json.j2 b/ansible/install/roles/grafana-dashboards/templates/openstack_general_system_performance.json.j2 index 238582e93..4c2104c80 100644 --- a/ansible/install/roles/grafana-dashboards/templates/openstack_general_system_performance.json.j2 +++ b/ansible/install/roles/grafana-dashboards/templates/openstack_general_system_performance.json.j2 @@ -1,7 +1,8 @@ {% set vars = {'panel_idx': 0, 'temp_count': 0} %} -{% set mariadb_groups = ['undercloud', 'controller', '*'] %} {% set gnocchi_groups = ['controller', '*'] %} +{% set httpd_groups = ['undercloud', 'controller', '*'] %} {% set ironic_groups = ['undercloud'] %} +{% set mariadb_groups = ['undercloud', 'controller', '*'] %} { "dashboard": { "annotations": { @@ -2594,6 +2595,290 @@ }, {% endfor %} {# End Loop over per-process options here #} + {% if item.template_node_type in httpd_groups %} + { + "title": "Apache", + "height": "250px", + "editable": true, + "collapse": true, + "panels": [ + { + "title": "Apache Bytes", + "error": false, + "span": 12, + "editable": true, + "type": "graph", + "isNew": true, + {% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %} + "id": {{vars.panel_idx}}, + "datasource": null, + "renderer": "flot", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "bytes", + "short" + ], + "grid": { + "leftLogBase": 1, + "leftMax": null, + "rightMax": null, + "leftMin": null, + "rightMin": null, + "rightLogBase": 1, + "threshold1": null, + "threshold2": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "lines": true, + "fill": 0, + "linewidth": 2, + "points": false, + "pointradius": 5, + "bars": false, + "stack": false, + "percentage": false, + "legend": { + "show": true, + "values": true, + "min": true, + "max": true, + "current": true, + "total": false, + "avg": false, + "alignAsTable": true, + "rightSide": true + }, + "nullPointMode": "connected", + "steppedLine": false, + "tooltip": { + "value_type": "cumulative", + "shared": true + }, + "timeFrom": null, + "timeShift": null, + "targets": [ + { + "refId": "A", + "target": "aliasSub(aliasByNode($Cloud.$Node.apache-status.apache_bytes, 3), 'apache_', '')", + "textEditor": false + } + ], + "aliasColors": {}, + "seriesOverrides": [], + "links": [] + }, + { + "title": "Apache Requests", + "error": false, + "span": 12, + "editable": true, + "type": "graph", + "isNew": true, + {% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %} + "id": {{vars.panel_idx}}, + "datasource": null, + "renderer": "flot", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "ops", + "short" + ], + "grid": { + "leftLogBase": 1, + "leftMax": null, + "rightMax": null, + "leftMin": null, + "rightMin": null, + "rightLogBase": 1, + "threshold1": null, + "threshold2": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "lines": true, + "fill": 0, + "linewidth": 2, + "points": false, + "pointradius": 5, + "bars": false, + "stack": false, + "percentage": false, + "legend": { + "show": true, + "values": true, + "min": true, + "max": true, + "current": true, + "total": false, + "avg": false, + "alignAsTable": true, + "rightSide": true + }, + "nullPointMode": "connected", + "steppedLine": false, + "tooltip": { + "value_type": "cumulative", + "shared": true + }, + "timeFrom": null, + "timeShift": null, + "targets": [ + { + "refId": "C", + "target": "aliasSub(aliasByNode($Cloud.$Node.apache-status.apache_requests, 3), 'apache_', '')", + "textEditor": false + } + ], + "aliasColors": {}, + "seriesOverrides": [], + "links": [] + }, + { + "title": "Apache Connections/Workers", + "error": false, + "span": 12, + "editable": true, + "type": "graph", + "isNew": true, + {% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %} + "id": {{vars.panel_idx}}, + "datasource": null, + "renderer": "flot", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "grid": { + "leftLogBase": 1, + "leftMax": null, + "rightMax": null, + "leftMin": null, + "rightMin": null, + "rightLogBase": 1, + "threshold1": null, + "threshold2": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "lines": true, + "fill": 0, + "linewidth": 2, + "points": false, + "pointradius": 5, + "bars": false, + "stack": false, + "percentage": false, + "legend": { + "show": true, + "values": true, + "min": true, + "max": true, + "current": true, + "total": false, + "avg": false, + "alignAsTable": true, + "rightSide": true + }, + "nullPointMode": "connected", + "steppedLine": false, + "tooltip": { + "value_type": "cumulative", + "shared": true + }, + "timeFrom": null, + "timeShift": null, + "targets": [ + { + "refId": "A", + "target": "aliasSub(aliasByNode($Cloud.$Node.apache-status.apache_connections, 3), 'apache_', '')", + "textEditor": false + }, + { + "refId": "B", + "target": "aliasSub(aliasByNode($Cloud.$Node.apache-status.apache_idle_workers, 3), 'apache_', '')", + "textEditor": false + } + ], + "aliasColors": {}, + "seriesOverrides": [], + "links": [] + }, + { + "title": "Apache Scoreboard", + "error": false, + "span": 12, + "editable": true, + "type": "graph", + "isNew": true, + {% if vars.update({'panel_idx': (vars.panel_idx + 1)}) %} {% endif %} + "id": {{vars.panel_idx}}, + "datasource": null, + "renderer": "flot", + "x-axis": true, + "y-axis": true, + "y_formats": [ + "short", + "short" + ], + "grid": { + "leftLogBase": 1, + "leftMax": null, + "rightMax": null, + "leftMin": null, + "rightMin": null, + "rightLogBase": 1, + "threshold1": null, + "threshold2": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "lines": true, + "fill": 1, + "linewidth": 2, + "points": false, + "pointradius": 5, + "bars": false, + "stack": true, + "percentage": false, + "legend": { + "show": true, + "values": true, + "min": true, + "max": true, + "current": true, + "total": false, + "avg": false, + "alignAsTable": true, + "rightSide": true + }, + "nullPointMode": "connected", + "steppedLine": false, + "tooltip": { + "value_type": "individual", + "shared": true + }, + "timeFrom": null, + "timeShift": null, + "targets": [ + { + "refId": "A", + "target": "aliasSub(aliasByNode($Cloud.$Node.apache-status.apache_scoreboard-*, 3), 'apache_scoreboard-', '')", + "textEditor": false + } + ], + "aliasColors": {}, + "seriesOverrides": [], + "links": [] + } + ], + "showTitle": true + }, + {% endif %} {% if item.template_node_type in mariadb_groups %} { "collapse": true,