diff --git a/ansible/install/roles/collectd/tasks/main.yml b/ansible/install/roles/collectd/tasks/main.yml index 5d6fc858e..b30f14db9 100644 --- a/ansible/install/roles/collectd/tasks/main.yml +++ b/ansible/install/roles/collectd/tasks/main.yml @@ -83,13 +83,6 @@ dest: "{{ browbeat_containers_path }}/collectd-openstack/config/collectd.conf" when: "config_type == 'compute' and ovn_compute_collectd_plugin" -- name: Add stack user to wheel - shell: | - podman exec -it -u root collectd-controller usermod -G wheel stack - become: yes - become_user: root - when: "config_type == 'controller' and ovn_monitoring" - - name: Build and Run container block: - name: Build collectd-openstack container @@ -118,3 +111,10 @@ {% endif %} collectd-openstack become: yes + +- name: Add stack user to wheel + shell: | + podman exec -it -u root collectd-controller usermod -G wheel stack + become: yes + become_user: root + when: "config_type == 'controller' and ovn_monitoring" diff --git a/browbeat-containers/collectd-openstack/files/ovn_monitoring.sh b/browbeat-containers/collectd-openstack/files/ovn_monitoring.sh index 0c0d906fc..b1741d0c0 100755 --- a/browbeat-containers/collectd-openstack/files/ovn_monitoring.sh +++ b/browbeat-containers/collectd-openstack/files/ovn_monitoring.sh @@ -4,5 +4,6 @@ INTERVAL="${COLLECTD_INTERVAL:-15}" while sleep "$INTERVAL"; do VALUE=$(sudo ovsdb-client dump --no-headings unix:/var/lib/openvswitch/ovn/ovn$1_db.sock $2 | wc -l) + VALUE=$[VALUE-1] echo "PUTVAL \"$HOSTNAME/ovn-$1db-$2/gauge-ovn_$1db_$2\" interval=$INTERVAL N:$VALUE" done