From 21fc376d97a5f74743e2b7cf7069349e874b979e Mon Sep 17 00:00:00 2001 From: Hemanth Nakkina Date: Fri, 4 Feb 2022 07:57:59 +0530 Subject: [ovn-central] collect NB/SB ovsdb-server cluster status Add commands to collect cluster status of Northbound and Southbound ovsdb servers. Resolves: #2840 Signed-off-by: Hemanth Nakkina hemanth.nakkina@canonical.com --- sos/report/plugins/ovn_central.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sos/report/plugins/ovn_central.py b/sos/report/plugins/ovn_central.py index 0f947d4c..2f0438df 100644 --- a/sos/report/plugins/ovn_central.py +++ b/sos/report/plugins/ovn_central.py @@ -84,6 +84,14 @@ class OVNCentral(Plugin): else: self.add_copy_spec("/var/log/ovn/*.log") + # ovsdb nb/sb cluster status commands + ovsdb_cmds = [ + 'ovs-appctl -t {} cluster/status OVN_Northbound'.format( + self.ovn_nbdb_sock_path), + 'ovs-appctl -t {} cluster/status OVN_Southbound'.format( + self.ovn_sbdb_sock_path), + ] + # Some user-friendly versions of DB output nbctl_cmds = [ 'ovn-nbctl show', @@ -109,7 +117,8 @@ class OVNCentral(Plugin): self.add_database_output(nb_tables, nbctl_cmds, 'ovn-nbctl') - cmds = nbctl_cmds + cmds = ovsdb_cmds + cmds += nbctl_cmds # Can only run sbdb commands if we are the leader co = {'cmd': "ovs-appctl -t {} cluster/status OVN_Southbound". @@ -148,10 +157,12 @@ class OVNCentral(Plugin): class RedHatOVNCentral(OVNCentral, RedHatPlugin): packages = ('openvswitch-ovn-central', 'ovn.*-central', ) + ovn_nbdb_sock_path = '/var/run/openvswitch/ovnnb_db.ctl' ovn_sbdb_sock_path = '/var/run/openvswitch/ovnsb_db.ctl' class DebianOVNCentral(OVNCentral, DebianPlugin, UbuntuPlugin): packages = ('ovn-central', ) + ovn_nbdb_sock_path = '/var/run/ovn/ovnnb_db.ctl' ovn_sbdb_sock_path = '/var/run/ovn/ovnsb_db.ctl' -- cgit