From 4a7c38b6bc170827f822f520c24c1289fc55125a Mon Sep 17 00:00:00 2001 From: Sanjay Chari Date: Wed, 29 Sep 2021 13:34:14 +0530 Subject: [PATCH] Change in OVN monitoring This patch changes the OVN monitoring collectd plugin and Grafana panels to include database name(nbdb or sbdb) along with the table name for the metrics. Change-Id: I9c8c034a591242d6d6c11f9cac4caed4fec20971 --- .../templates/partials/ovn_db_tables.yaml | 30 ++++++++++--------- .../files/ovn_monitoring.sh | 4 +-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/ansible/install/roles/grafana-dashboards/templates/partials/ovn_db_tables.yaml b/ansible/install/roles/grafana-dashboards/templates/partials/ovn_db_tables.yaml index 4959f3367..0d207fa69 100644 --- a/ansible/install/roles/grafana-dashboards/templates/partials/ovn_db_tables.yaml +++ b/ansible/install/roles/grafana-dashboards/templates/partials/ovn_db_tables.yaml @@ -17,17 +17,19 @@ values: true nullPointMode: 'null' targets: - - target: alias($Cloud.$Node.ovn-ACL.gauge-ovn_ACL, 'ovn_ACL') - - target: alias($Cloud.$Node.ovn-Address_Set.gauge-ovn_Address_Set, 'ovn_Address_Set') - - target: alias($Cloud.$Node.ovn-Datapath_Binding.gauge-ovn_Datapath_Binding, 'ovn_Datapath_Binding') - - target: alias($Cloud.$Node.ovn-Load_Balancer.gauge-ovn_Load_Balancer, 'ovn_Load_Balancer') - - target: alias($Cloud.$Node.ovn-Logical_Flow.gauge-ovn_Logical_Flow, 'ovn_Logical_Flow') - - target: alias($Cloud.$Node.ovn-Logical_Router.gauge-ovn_Logical_Router, 'ovn_Logical_Router') - - target: alias($Cloud.$Node.ovn-Logical_Router_Port.gauge-ovn_Logical_Router_Port, 'ovn_Logical_Router_Port') - - target: alias($Cloud.$Node.ovn-Logical_Router_Static_Route.gauge-ovn_Logical_Router_Static_Route, 'ovn_Logical_Router_Static_Route') - - target: alias($Cloud.$Node.ovn-Logical_Switch.gauge-ovn_Logical_Switch, 'ovn_Logical_Switch') - - target: alias($Cloud.$Node.ovn-Logical_Switch_Port.gauge-ovn_Logical_Switch_Port, 'ovn_Logical_Switch_Port') - - target: alias($Cloud.$Node.ovn-MAC_Binding.gauge-ovn_MAC_Binding, 'ovn_MAC_Binding') - - target: alias($Cloud.$Node.ovn-Multicast_Group.gauge-ovn_Multicast_Group, 'ovn_Multicast_Group') - - target: alias($Cloud.$Node.ovn-Port_Binding.gauge-ovn_Port_Binding, 'ovn_Port_Binding') - - target: alias($Cloud.$Node.ovn-Port_Group.gauge-ovn_Port_Group, 'ovn_Port_Group') + - target: alias($Cloud.$Node.ovn-sbdb-Address_Set.gauge-ovn_sbdb_Address_Set, 'ovn_sbdb_Address_Set') + - target: alias($Cloud.$Node.ovn-sbdb-MAC_Binding.gauge-ovn_sbdb_MAC_Binding, 'ovn_sbdb_MAC_Binding') + - target: alias($Cloud.$Node.ovn-sbdb-Multicast_Group.gauge-ovn_sbdb_Multicast_Group, 'ovn_sbdb_Multicast_Group') + - target: alias($Cloud.$Node.ovn-sbdb-Port_Binding.gauge-ovn_sbdb_Port_Binding, 'ovn_sbdb_Port_Binding') + - target: alias($Cloud.$Node.ovn-sbdb-Port_Group.gauge-ovn_sbdb_Port_Group, 'ovn_sbdb_Port_Group') + - target: alias($Cloud.$Node.ovn-sbdb-Datapath_Binding.gauge-ovn_sbdb_Datapath_Binding, 'ovn_sbdb_Datapath_Binding') + - target: alias($Cloud.$Node.ovn-sbdb-Logical_Flow.gauge-ovn_sbdb_Logical_Flow, 'ovn_sbdb_Logical_Flow') + - target: alias($Cloud.$Node.ovn-nbdb-Load_Balancer.gauge-ovn_nbdb_Load_Balancer, 'ovn_nbdb_Load_Balancer') + - target: alias($Cloud.$Node.ovn-nbdb-ACL.gauge-ovn_nbdb_ACL, 'ovn_nbdb_ACL') + - target: alias($Cloud.$Node.ovn-nbdb-Address_Set.gauge-ovn_nbdb_Address_Set, 'ovn_nbdb_Address_Set') + - target: alias($Cloud.$Node.ovn-nbdb-Logical_Router.gauge-ovn_nbdb_Logical_Router, 'ovn_nbdb_Logical_Router') + - target: alias($Cloud.$Node.ovn-nbdb-Logical_Router_Port.gauge-ovn_nbdb_Logical_Router_Port, 'ovn_nbdb_Logical_Router_Port') + - target: alias($Cloud.$Node.ovn-nbdb-Logical_Router_Static_Route.gauge-ovn_nbdb_Logical_Router_Static_Route, 'ovn_nbdb_Logical_Router_Static_Route') + - target: alias($Cloud.$Node.ovn-nbdb-Logical_Switch.gauge-ovn_nbdb_Logical_Switch, 'ovn_nbdb_Logical_Switch') + - target: alias($Cloud.$Node.ovn-nbdb-Logical_Switch_Port.gauge-ovn_nbdb_Logical_Switch_Port, 'ovn_nbdb_Logical_Switch_Port') + - target: alias($Cloud.$Node.ovn-nbdb-Port_Group.gauge-ovn_nbdb_Port_Group, 'ovn_nbdb_Port_Group') diff --git a/browbeat-containers/collectd-openstack/files/ovn_monitoring.sh b/browbeat-containers/collectd-openstack/files/ovn_monitoring.sh index cc72662ba..0c0d906fc 100755 --- a/browbeat-containers/collectd-openstack/files/ovn_monitoring.sh +++ b/browbeat-containers/collectd-openstack/files/ovn_monitoring.sh @@ -3,6 +3,6 @@ HOSTNAME="${COLLECTD_HOSTNAME:-`hostname -f`}" INTERVAL="${COLLECTD_INTERVAL:-15}" while sleep "$INTERVAL"; do - VALUE=$(sudo ovsdb-client dump unix:/var/lib/openvswitch/ovn/ovn$1_db.sock $2 | wc -l) - echo "PUTVAL \"$HOSTNAME/ovn-$2/gauge-ovn_$2\" interval=$INTERVAL N:$VALUE" + VALUE=$(sudo ovsdb-client dump --no-headings unix:/var/lib/openvswitch/ovn/ovn$1_db.sock $2 | wc -l) + echo "PUTVAL \"$HOSTNAME/ovn-$1db-$2/gauge-ovn_$1db_$2\" interval=$INTERVAL N:$VALUE" done