Merge "Add Virt Collectd plugin"

This commit is contained in:
Zuul 2023-01-12 07:09:33 +00:00 committed by Gerrit Code Review
commit 695ea169c6
6 changed files with 95 additions and 2 deletions

View File

@ -409,6 +409,11 @@ osp_individual_resources_response_time: false
# all metrics on all compute nodes
ovn_compute_collectd_plugin: false
#######################################################################
# Virt plugin to monitor resources in VMs on computes
#######################################################################
virt_collectd_plugin: false
############################################
# Prometheus/Collectd-Exporter Configuration
############################################

View File

@ -270,6 +270,9 @@
{% if config_type == 'controller' and ceph_controller_collectd_plugin and inventory_hostname == groups['Controller'][0] %}
-v /etc/ceph/:/etc/ceph/ -v /var/run/ceph/:/var/run/ceph \
{% endif %}
{% if config_type == 'compute' and virt_collectd_plugin %}
-v /var/run/libvirt/libvirt-sock-ro:/var/run/libvirt/libvirt-sock-ro \
{% endif %}
{% if config_type == 'cephstorage' and ceph_storage_collectd_plugin and inventory_hostname == groups['CephStorage'][0] %}
-v /var/run/ceph/:/var/run/ceph \
{% endif %}

View File

@ -48,6 +48,9 @@ LoadPlugin processes
LoadPlugin swap
LoadPlugin tail
LoadPlugin uptime
{% if virt_collectd_plugin %}
LoadPlugin virt
{% endif %}
PreCacheChain "PreCache"
<Chain "PreCache">
@ -127,6 +130,15 @@ PreCacheChain "PreCache"
ReportInodes true
</Plugin>
{% if virt_collectd_plugin %}
<Plugin virt>
Connection "qemu:///system"
RefreshInterval 60
HostnameFormat name hostname uuid
ExtraStats "cpu_util disk job_stats_background"
</Plugin>
{% endif %}
{%if disk_compute_collectd_plugin %}
<Plugin disk>
Disk "/^[hsv]d[a-z]+[0-9]?$/"
@ -159,6 +171,7 @@ PreCacheChain "PreCache"
</Plugin>
{% endif %}
# (akrzos) Including the version of OpenStack that the process was verified as running after
# OpenStack Installation with a comment at the end of each Process/ProcessMatch statement.
# A Minus before the version means the process was not found in that version. (Ex -10)

View File

@ -177,6 +177,8 @@ dashboard:
{% include 'partials/tail.yaml' %}
{% include 'partials/virt_monitoring.yaml' %}
{% if item.template_node_type in sqlalchemy_groups %}
{% include 'partials/sqlalchemy.yaml' %}
{% endif %}

View File

@ -0,0 +1,70 @@
- title: Virt Metrics
collapse: true
height: 200px
showTitle: true
panels:
- title: $Cloud - $Node - Virt Disk Metrics
type: graph
legend:
alignAsTable: true
avg: false
current: true
max: true
min: true
rightSide: true
show: true
total: false
values: true
nullPointMode: 'null'
targets:
- target: aliasByNode($Cloud.$Node.virt.disk*.*, 3, 4)
- target: aliasByMetric($Cloud.$Node.virt.total*)
- title: $Cloud - $Node - Virt Network Metrics
type: graph
legend:
alignAsTable: true
avg: false
current: true
max: true
min: true
rightSide: true
show: true
total: false
values: true
nullPointMode: 'null'
targets:
- target: aliasByNode($Cloud.$Node.virt.if*.*, 3, 4)
- title: $Cloud - $Node - Virt Memory Metrics
type: graph
legend:
alignAsTable: true
avg: false
current: true
max: true
min: true
rightSide: true
show: true
total: false
values: true
nullPointMode: 'null'
targets:
- target: alias($Cloud.$Node.virt.memory-total, 'memory-total')
- title: $Cloud - $Node - Virt vCPU Metrics
type: graph
legend:
alignAsTable: true
avg: false
current: true
max: true
min: true
rightSide: true
show: true
total: false
values: true
nullPointMode: 'null'
targets:
- target: alias($Cloud.$Node.virt.percent-virt_cpu_total, 'percent-virt_cpu_total')
- target: alias($Cloud.$Node.virt.virt_cpu_total, 'virt_cpu_total')

View File

@ -5,7 +5,7 @@ RUN dnf clean all && \
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && \
dnf install -y centos-release-opstools && \
dnf install -y collectd collectd-turbostat collectd-disk collectd-apache collectd-ceph \
collectd-mysql collectd-python collectd-ping python3-sqlalchemy-collectd && \
collectd-mysql collectd-python collectd-ping collectd-virt python3-sqlalchemy-collectd && \
dnf install -y sysstat && \
dnf install -y python3-pip python3-devel && \
pip3 install --upgrade pip && \
@ -22,7 +22,7 @@ RUN useradd stack
RUN echo stack | passwd stack --stdin
RUN echo "stack ALL=(root) NOPASSWD:ALL" | tee -a /etc/sudoers.d/stack
RUN chmod 0440 /etc/sudoers.d/stack
RUN rm /etc/collectd.d/virt.conf
ADD files/collectd_ceph_storage.py /usr/local/bin/collectd_ceph_storage.py
ADD files/collectd_gnocchi_status.py /usr/local/bin/collectd_gnocchi_status.py