X7ROOT File Manager
Current Path:
/usr/lib/python3.6/site-packages/sos/report/plugins
usr
/
lib
/
python3.6
/
site-packages
/
sos
/
report
/
plugins
/
📁
..
📄
__init__.py
(138.51 KB)
📁
__pycache__
📄
aap_containerized.py
(5.04 KB)
📄
aap_controller.py
(3.15 KB)
📄
aap_eda.py
(2.16 KB)
📄
aap_gateway.py
(1.71 KB)
📄
aap_hub.py
(1.31 KB)
📄
aap_receptor.py
(1.85 KB)
📄
abrt.py
(1.51 KB)
📄
acpid.py
(917 B)
📄
activemq.py
(1.65 KB)
📄
aide.py
(1.41 KB)
📄
alternatives.py
(2.27 KB)
📄
anaconda.py
(1.46 KB)
📄
anacron.py
(782 B)
📄
ansible.py
(1.08 KB)
📄
apache.py
(6 KB)
📄
apparmor.py
(1.05 KB)
📄
apport.py
(1.37 KB)
📄
apt.py
(1.73 KB)
📄
arcconf.py
(2.17 KB)
📄
ata.py
(1016 B)
📄
auditd.py
(1.83 KB)
📄
authd.py
(2.2 KB)
📄
autofs.py
(2.77 KB)
📄
azure.py
(2.37 KB)
📄
bcache.py
(2.2 KB)
📄
bird.py
(2.41 KB)
📄
block.py
(2.44 KB)
📄
boom.py
(1.05 KB)
📄
boot.py
(1.99 KB)
📄
bootc.py
(940 B)
📄
btrfs.py
(739 B)
📄
buildah.py
(1.82 KB)
📄
candlepin.py
(5.84 KB)
📄
canonical_livepatch.py
(1.04 KB)
📄
canonical_livepatch_onprem.py
(1.22 KB)
📄
ceph_ansible.py
(956 B)
📄
ceph_common.py
(6.83 KB)
📄
ceph_iscsi.py
(1.55 KB)
📄
ceph_mds.py
(4.15 KB)
📄
ceph_mgr.py
(5.92 KB)
📄
ceph_mon.py
(9.82 KB)
📄
ceph_osd.py
(5.27 KB)
📄
ceph_rgw.py
(4.51 KB)
📄
cgroups.py
(1.39 KB)
📄
charmed_mysql.py
(5.23 KB)
📄
charmed_postgresql.py
(6.05 KB)
📄
chrony.py
(1.84 KB)
📄
cifs.py
(962 B)
📄
clear_containers.py
(2.58 KB)
📄
cloud_init.py
(1.07 KB)
📄
cman.py
(1.78 KB)
📄
cobbler.py
(1.29 KB)
📄
cockpit.py
(968 B)
📄
collectd.py
(2.24 KB)
📄
collectl.py
(752 B)
📄
composer.py
(2.11 KB)
📄
conntrack.py
(2.37 KB)
📄
console.py
(869 B)
📄
container_log.py
(1.54 KB)
📄
containerd.py
(1.37 KB)
📄
containers_common.py
(2.64 KB)
📄
convert2rhel.py
(1.04 KB)
📄
coredump.py
(5.14 KB)
📄
corosync.py
(2.41 KB)
📄
crio.py
(3.38 KB)
📄
cron.py
(1.01 KB)
📄
crypto.py
(1.38 KB)
📄
cs.py
(4.5 KB)
📄
ctdb.py
(1.42 KB)
📄
cups.py
(3.08 KB)
📄
curtin.py
(1.74 KB)
📄
cxl.py
(1.32 KB)
📄
date.py
(867 B)
📄
dbus.py
(877 B)
📄
dellrac.py
(1.69 KB)
📄
devicemapper.py
(1.13 KB)
📄
devices.py
(740 B)
📄
dhcp.py
(1.03 KB)
📄
discovery.py
(1.15 KB)
📄
distupgrade.py
(1.51 KB)
📄
dlm.py
(1.52 KB)
📄
dmraid.py
(1.29 KB)
📄
dnf.py
(5.42 KB)
📄
docker.py
(5.08 KB)
📄
docker_distribution.py
(1.3 KB)
📄
dovecot.py
(1007 B)
📄
dpkg.py
(1.16 KB)
📄
dracut.py
(942 B)
📄
drbd.py
(955 B)
📄
ds.py
(3.6 KB)
📄
ebpf.py
(3.11 KB)
📄
elastic.py
(2.5 KB)
📄
etcd.py
(2.14 KB)
📄
fail2ban.py
(830 B)
📄
fapolicyd.py
(1.34 KB)
📄
fcoe.py
(1018 B)
📄
fibrechannel.py
(1.77 KB)
📄
filesys.py
(3.81 KB)
📄
firewall_tables.py
(5.07 KB)
📄
firewalld.py
(1.95 KB)
📄
flatpak.py
(1.29 KB)
📄
foreman.py
(15.24 KB)
📄
foreman_installer.py
(3.86 KB)
📄
foreman_openscap.py
(830 B)
📄
foreman_proxy.py
(2.19 KB)
📄
freeipmi.py
(896 B)
📄
frr.py
(1.79 KB)
📄
fwupd.py
(1.41 KB)
📄
gcp.py
(5.38 KB)
📄
gdm.py
(735 B)
📄
gfs2.py
(1.36 KB)
📄
gluster.py
(4.34 KB)
📄
gluster_block.py
(1.07 KB)
📄
grafana.py
(2.01 KB)
📄
greenboot.py
(905 B)
📄
grub.py
(988 B)
📄
grub2.py
(2.81 KB)
📄
gssproxy.py
(823 B)
📄
haproxy.py
(2.41 KB)
📄
hardware.py
(1.13 KB)
📄
helm.py
(1.14 KB)
📄
host.py
(1.74 KB)
📄
hpasm.py
(898 B)
📄
hpssm.py
(2.65 KB)
📄
hts.py
(700 B)
📄
hyperv.py
(886 B)
📄
i18n.py
(774 B)
📄
infiniband.py
(2.66 KB)
📄
infinidat.py
(1.38 KB)
📄
insights.py
(2.49 KB)
📄
instructlab.py
(5.45 KB)
📄
ipa.py
(7.36 KB)
📄
ipmitool.py
(1.53 KB)
📄
iprconfig.py
(4.53 KB)
📄
ipvs.py
(1.04 KB)
📄
iscsi.py
(2.15 KB)
📄
iscsitarget.py
(1.25 KB)
📄
jars.py
(5.39 KB)
📄
java.py
(978 B)
📄
juju.py
(8.03 KB)
📄
kafka.py
(2.07 KB)
📄
kata_containers.py
(1.34 KB)
📄
kdump.py
(5.63 KB)
📄
kea.py
(1.37 KB)
📄
keepalived.py
(855 B)
📄
kernel.py
(5.85 KB)
📄
kernelrt.py
(1.66 KB)
📄
keyutils.py
(894 B)
📄
kimchi.py
(1009 B)
📄
kpatch.py
(1.02 KB)
📄
krb5.py
(2.88 KB)
📄
kubernetes.py
(12.45 KB)
📄
kvm.py
(954 B)
📄
landscape.py
(3.17 KB)
📄
ldap.py
(2.99 KB)
📄
leapp.py
(1.49 KB)
📄
libraries.py
(1.56 KB)
📄
libreswan.py
(2.47 KB)
📄
libvirt.py
(3.76 KB)
📄
lightdm.py
(1.11 KB)
📄
lilo.py
(716 B)
📄
login.py
(1.06 KB)
📄
logrotate.py
(1.24 KB)
📄
logs.py
(3.92 KB)
📄
lstopo.py
(1.2 KB)
📄
lustre.py
(2.86 KB)
📄
lvm2.py
(4.6 KB)
📄
lxd.py
(4.31 KB)
📄
maas.py
(5.07 KB)
📄
manageiq.py
(2.86 KB)
📄
md.py
(1.22 KB)
📄
megacli.py
(1.01 KB)
📄
mellanox_firmware.py
(4.7 KB)
📄
memcached.py
(1.58 KB)
📄
memory.py
(1.44 KB)
📄
microcloud.py
(2.72 KB)
📄
microk8s.py
(4.38 KB)
📄
microovn.py
(3.23 KB)
📄
microshift.py
(6.96 KB)
📄
microshift_ovn.py
(1.69 KB)
📄
migration_results.py
(637 B)
📄
mongodb.py
(4.14 KB)
📄
monit.py
(1.68 KB)
📄
mpt.py
(732 B)
📄
mssql.py
(3.29 KB)
📄
multipath.py
(1011 B)
📄
mvcli.py
(1003 B)
📄
mysql.py
(4.44 KB)
📄
named.py
(2.5 KB)
📄
navicli.py
(2.47 KB)
📄
networking.py
(14.36 KB)
📄
networkmanager.py
(5.04 KB)
📄
nfs.py
(1.32 KB)
📄
nfsganesha.py
(1.2 KB)
📄
nginx.py
(1.53 KB)
📄
nis.py
(812 B)
📄
nodejs.py
(1.18 KB)
📄
npm.py
(2.06 KB)
📄
nscd.py
(989 B)
📄
nss.py
(885 B)
📄
ntb.py
(937 B)
📄
ntp.py
(1.41 KB)
📄
numa.py
(1.46 KB)
📄
nvidia.py
(1.82 KB)
📄
nvme.py
(1.71 KB)
📄
nvmetcli.py
(977 B)
📄
oddjob.py
(871 B)
📄
omnipath_client.py
(1.92 KB)
📄
omnipath_manager.py
(2.38 KB)
📄
omsa.py
(1.64 KB)
📄
opencl.py
(692 B)
📄
opencontrail.py
(1.35 KB)
📄
opendaylight.py
(1.38 KB)
📄
opengl.py
(694 B)
📄
openhpi.py
(878 B)
📄
openshift.py
(16.88 KB)
📄
openshift_ovn.py
(2.61 KB)
📄
openssl.py
(1.4 KB)
📄
openstack_ansible.py
(1.31 KB)
📄
openstack_aodh.py
(3.93 KB)
📄
openstack_barbican.py
(1.76 KB)
📄
openstack_ceilometer.py
(3.24 KB)
📄
openstack_cinder.py
(6.84 KB)
📄
openstack_database.py
(2.47 KB)
📄
openstack_designate.py
(3.58 KB)
📄
openstack_edpm.py
(1.45 KB)
📄
openstack_glance.py
(4.67 KB)
📄
openstack_gnocchi.py
(4.27 KB)
📄
openstack_heat.py
(5.34 KB)
📄
openstack_horizon.py
(3.37 KB)
📄
openstack_instack.py
(5.98 KB)
📄
openstack_ironic.py
(8.28 KB)
📄
openstack_keystone.py
(4.9 KB)
📄
openstack_manila.py
(3.68 KB)
📄
openstack_masakari.py
(2.08 KB)
📄
openstack_masakarimonitors.py
(1.5 KB)
📄
openstack_mistral.py
(1.6 KB)
📄
openstack_neutron.py
(6.29 KB)
📄
openstack_nova.py
(8.75 KB)
📄
openstack_novajoin.py
(1.15 KB)
📄
openstack_octavia.py
(5.16 KB)
📄
openstack_placement.py
(5.01 KB)
📄
openstack_sahara.py
(2.67 KB)
📄
openstack_swift.py
(2.95 KB)
📄
openstack_tripleo.py
(1.62 KB)
📄
openstack_trove.py
(2.26 KB)
📄
opensvc.py
(3.39 KB)
📄
openvswitch.py
(17.47 KB)
📄
oratab.py
(1.92 KB)
📄
origin.py
(8.57 KB)
📄
os_net_config.py
(800 B)
📄
ostree.py
(1.05 KB)
📄
ovirt.py
(9.44 KB)
📄
ovirt_engine_backup.py
(1.72 KB)
📄
ovirt_hosted_engine.py
(2.16 KB)
📄
ovirt_imageio.py
(1.56 KB)
📄
ovirt_node.py
(1.62 KB)
📄
ovirt_provider_ovn.py
(1.16 KB)
📄
ovn_central.py
(9.86 KB)
📄
ovn_host.py
(3.32 KB)
📄
pacemaker.py
(5.81 KB)
📄
pam.py
(1.37 KB)
📄
pci.py
(1.35 KB)
📄
pcp.py
(6.05 KB)
📄
perccli.py
(1.81 KB)
📄
perccli2.py
(1.82 KB)
📄
peripety.py
(1.19 KB)
📄
perl.py
(662 B)
📄
pmem.py
(3.34 KB)
📄
podman.py
(5.49 KB)
📄
postfix.py
(4.32 KB)
📄
postgresql.py
(4.36 KB)
📄
powerpath.py
(1.82 KB)
📄
powerpc.py
(4.22 KB)
📄
ppp.py
(848 B)
📄
procenv.py
(710 B)
📄
process.py
(4.29 KB)
📄
processor.py
(2.56 KB)
📄
proxmox.py
(2.98 KB)
📄
psacct.py
(1.29 KB)
📄
ptp.py
(892 B)
📄
pulp.py
(7.66 KB)
📄
pulpcore.py
(7.8 KB)
📄
pulseaudio.py
(1.56 KB)
📄
puppet.py
(2.26 KB)
📄
pxe.py
(1.39 KB)
📄
python.py
(3.79 KB)
📄
qaucli.py
(1.35 KB)
📄
qpid.py
(3.53 KB)
📄
qpid_dispatch.py
(2.19 KB)
📄
qt.py
(809 B)
📄
quagga.py
(755 B)
📄
rabbitmq.py
(2.73 KB)
📄
radius.py
(1.34 KB)
📄
rasdaemon.py
(994 B)
📄
rear.py
(1.31 KB)
📄
redis.py
(1.6 KB)
📄
release.py
(1.2 KB)
📄
rhc.py
(2.02 KB)
📄
rhcos.py
(1.36 KB)
📄
rhui.py
(2.27 KB)
📄
rhv_analyzer.py
(941 B)
📄
rpm.py
(2.34 KB)
📄
rpmostree.py
(1.12 KB)
📄
ruby.py
(813 B)
📄
s390.py
(2.38 KB)
📄
salt.py
(2.14 KB)
📄
saltmaster.py
(2.26 KB)
📄
samba.py
(1.79 KB)
📄
sanlock.py
(1000 B)
📄
saphana.py
(2.52 KB)
📄
sapnw.py
(5.03 KB)
📄
sar.py
(3.95 KB)
📄
sas3ircu.py
(1.3 KB)
📄
scsi.py
(2.4 KB)
📄
seagate_ses.py
(2.1 KB)
📄
sedutil.py
(1.7 KB)
📄
selinux.py
(2.02 KB)
📄
sendmail.py
(1.18 KB)
📄
services.py
(1.43 KB)
📄
shmcli.py
(4.21 KB)
📄
skydive.py
(2.28 KB)
📄
slurm.py
(3.75 KB)
📄
smartcard.py
(1.49 KB)
📄
smclient.py
(1.89 KB)
📄
snap.py
(2.99 KB)
📄
snapper.py
(741 B)
📄
snmp.py
(903 B)
📄
sos_extras.py
(3.74 KB)
📄
soundcard.py
(980 B)
📄
squid.py
(1.25 KB)
📄
ssh.py
(3.73 KB)
📄
ssmtp.py
(976 B)
📄
sssd.py
(2.33 KB)
📄
storageconsole.py
(1.66 KB)
📄
storcli.py
(1.8 KB)
📄
stratis.py
(1.12 KB)
📄
subscription_manager.py
(5.55 KB)
📄
sudo.py
(1.48 KB)
📄
sunbeam.py
(6.89 KB)
📄
sunbeam_hypervisor.py
(3.73 KB)
📄
sunrpc.py
(818 B)
📄
symcli.py
(3.46 KB)
📄
system.py
(1.67 KB)
📄
systemd.py
(3.68 KB)
📄
systemtap.py
(881 B)
📄
sysvipc.py
(886 B)
📄
targetcli.py
(1.12 KB)
📄
teamd.py
(1.24 KB)
📄
telegraf.py
(1.68 KB)
📄
tftpserver.py
(879 B)
📄
tigervnc.py
(1.67 KB)
📄
tomcat.py
(2.08 KB)
📄
tpm2.py
(989 B)
📄
tuned.py
(1.17 KB)
📄
ubuntu.py
(2.23 KB)
📄
udev.py
(900 B)
📄
udisks.py
(804 B)
📄
ufw.py
(987 B)
📄
ultrapath.py
(1.3 KB)
📄
unbound.py
(899 B)
📄
unity.py
(703 B)
📄
unpackaged.py
(3.48 KB)
📄
usb.py
(731 B)
📄
usbguard.py
(813 B)
📄
validation_framework.py
(1.5 KB)
📄
valkey.py
(1.72 KB)
📄
vault.py
(1.74 KB)
📄
vdo.py
(2.27 KB)
📄
vdsm.py
(5.05 KB)
📄
vectordev.py
(1.2 KB)
📄
veritas.py
(1.33 KB)
📄
vhostmd.py
(1.71 KB)
📄
virsh.py
(4.42 KB)
📄
virtwho.py
(985 B)
📄
vmware.py
(1.74 KB)
📄
vsftpd.py
(724 B)
📄
vulkan.py
(700 B)
📄
watchdog.py
(2.89 KB)
📄
wireless.py
(886 B)
📄
x11.py
(1.38 KB)
📄
xdp.py
(659 B)
📄
xen.py
(3.32 KB)
📄
xfs.py
(1.34 KB)
📄
xinetd.py
(837 B)
📄
zfs.py
(1.91 KB)
📄
zvm.py
(2.76 KB)
Editing: openvswitch.py
# Copyright (C) 2014 Adam Stokes <adam.stokes@ubuntu.com> # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Public License. # # See the LICENSE file in the source distribution for further information. from os import environ import re from sos.report.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin class OpenVSwitch(Plugin): short_desc = 'OpenVSwitch networking' plugin_name = "openvswitch" profiles = ('network', 'virt') actl = "ovs-appctl" vctl = "ovs-vsctl" ofctl = "ovs-ofctl" dpctl = "ovs-dpctl" check_dpdk = False check_6wind = False def setup(self): all_logs = self.get_option("all_logs") log_dirs = [ '/var/log/openvswitch/', '/usr/local/var/log/openvswitch/', ] dpdk_enabled = self.collect_cmd_output( f"{self.vctl} -t 5 get Open_vSwitch . other_config:dpdk-init") self.check_dpdk = (dpdk_enabled["status"] == 0 and dpdk_enabled["output"].startswith('"true"')) self.check_6wind = any(self.is_installed(p) for p in ['6windgate-fp', 'nuage-openvswitch']) if environ.get('OVS_LOGDIR'): log_dirs.append(environ.get('OVS_LOGDIR')) if not all_logs: self.add_copy_spec([ self.path_join(ld, '*.log') for ld in log_dirs ]) else: self.add_copy_spec(log_dirs) self.add_copy_spec([ "/run/openvswitch/ovsdb-server.pid", "/run/openvswitch/ovs-vswitchd.pid", "/run/openvswitch/ovs-monitor-ipsec.pid" ]) self.add_copy_spec([ self.path_join('/usr/local/etc/openvswitch', 'conf.db'), self.path_join('/etc/openvswitch', 'conf.db'), self.path_join('/var/lib/openvswitch', 'conf.db'), ]) ovs_dbdir = environ.get('OVS_DBDIR') if ovs_dbdir: self.add_copy_spec(self.path_join(ovs_dbdir, 'conf.db')) self.add_file_tags({ "/var/log/openvswitch/ovs-vswitchd.log": "openvswitch_daemon_log", "/var/log/openvswitch/ovsdb-server.log": "openvswitch_server_log" }) self.add_dir_listing([ '/run/openvswitch', '/dev/hugepages/', '/dev/vfio', '/var/lib/vhost_sockets', ]) self.add_cmd_output([ # List devices and their drivers "dpdk_nic_bind --status", "dpdk-devbind.py --status", "driverctl list-devices", "driverctl -v list-devices", "driverctl list-overrides", "driverctl -v list-overrides", "driverctl list-persisted", # Capture a list of all bond devices f"{self.actl} bond/list", # Capture more details from bond devices f"{self.actl} bond/show", # Capture LACP details f"{self.actl} lacp/show", f"{self.actl} lacp/show-stats", # Capture coverage stats" f"{self.actl} coverage/show", # Capture cached routes f"{self.actl} ovs/route/show", # Capture tnl arp table" f"{self.actl} tnl/arp/show", # Capture a list of listening ports" f"{self.actl} tnl/ports/show -v", # Capture upcall information f"{self.actl} upcall/show", # Capture OVS list f"{self.vctl} -t 5 list Open_vSwitch", # Capture OVS manager f"{self.vctl} -t 5 list manager", # Capture OVS interface list f"{self.vctl} -t 5 list interface", # Capture OVS detailed information from all the bridges f"{self.vctl} -t 5 list bridge", # Capture OVS datapath list f"{self.vctl} -t 5 list datapath", # Capture DPDK queue to pmd mapping f"{self.actl} dpif-netdev/pmd-rxq-show -secs 5", f"{self.actl} dpif-netdev/pmd-rxq-show -secs 30", f"{self.actl} dpif-netdev/pmd-rxq-show", # Capture DPDK pmd stats f"{self.actl} dpif-netdev/pmd-stats-show", # Capture DPDK pmd performance counters f"{self.actl} dpif-netdev/pmd-perf-show", # Capture ofproto tunnel configs f"{self.actl} ofproto/list-tunnels", # Capture ipsec tunnel information f"{self.actl} -t ovs-monitor-ipsec tunnels/show", f"{self.actl} -t ovs-monitor-ipsec xfrm/state", f"{self.actl} -t ovs-monitor-ipsec xfrm/policies", # Capture OVS offload enabled flows f"{self.dpctl} dump-flows --name -m type=offloaded", # Capture OVS slowdatapth flows f"{self.dpctl} dump-flows --name -m type=ovs", # Capture dpcls implementations f"{self.actl} dpif-netdev/subtable-lookup-prio-get", # Capture dpif implementations f"{self.actl} dpif-netdev/dpif-impl-get", # Capture miniflow extract implementations f"{self.actl} dpif-netdev/miniflow-parser-get", # Capture DPDK pmd sleep config f"{self.actl} dpif-netdev/pmd-sleep-show", # Capture additional DPDK info f"{self.actl} dpdk/lcore-list", f"{self.actl} dpdk/log-list", f"{self.actl} dpdk/get-malloc-stats", # Capture dpdk mempool info f"{self.actl} netdev-dpdk/get-mempool-info" ]) # Capture DPDK and other parameters self.add_cmd_output( f"{self.vctl} -t 5 get Open_vSwitch . other_config", tags="openvswitch_other_config") # The '-t 5' adds an upper bound on how long to wait to connect # to the Open vSwitch server, avoiding hangs when running sos. self.add_cmd_output(f"{self.vctl} -t 5 show", tags="ovs_vsctl_show") # Gather systemd services logs self.add_journal(units="openvswitch") self.add_journal(units="openvswitch-nonetwork") self.add_journal(units="ovs-vswitchd") self.add_journal(units="ovsdb-server") self.add_journal(units="ovs-configuration") self.add_journal(units="openvswitch-ipsec") self.collect_ovs_info() self.collect_datapath() self.collect_ovs_bridge_info() def collect_ovs_info(self): """ Collect output of OVS commands """ files_6wind = [ "/etc/systemd/system/multi-user.target.wants/openvswitch.service", "/etc/sysctl.d/60-6wind-system-auto-reboot.conf", "/etc/openvswitch/system-id.conf", "/etc/openvswitch/*.db", "/etc/ld.so.conf.d/linux-fp-sync-fptun.conf", "/etc/NetworkManager/conf.d/fpn0.conf", "/etc/default/openvswitch", "/etc/logrotate.d/openvswitch", "/etc/linux-fp-sync.env", "/etc/fp-daemons.env", "/etc/fp-vdev.ini", "/etc/fpm.env", "/etc/6WINDGate/fp.config", "/etc/6WINDGate/fpnsdk.config", "/etc/dms.d/fp-dms.conf", "/etc/dms.d/fpmd-dms.conf", "/etc/dms.d/fpsd-dms.conf", "/etc/fast-path.env", "/etc/fps-fp.env", ] if self.check_6wind: self.add_copy_spec(files_6wind) self.add_cmd_output([ # Various fast-path stats "fp-cli fp-vswitch-stats", "fp-cli dpdk-core-port-mapping", "fp-cpu-usage", "fp-cli fp-vswitch-masks", "fp-cli fp-vswitch-flows", "fp-shmem-dpvi", "fp-cli stats non-zero", "fp-cli stats", "fp-cli dpdk-cp-filter-budget", f"{self.actl} vm/port-detailed-show", f"{self.actl} upcall/show", "fp-cli nfct4", f"{self.actl} vm/port-vip-list-show", "fp-shmem-ports -s", f"{self.dpctl} show -s", "fpcmd fp-vswitch-flows", "fp-cli fp-vswitch-ports percore", "fp-cli dpdk-debug-pool", "fp-cli dump-size", "fp-cli conf runtime", "fp-cli conf compiled", "fp-cli iface", f"{self.actl} memory/show", ]) self.add_journal(units="virtual-accelerator") for table in ['filter', 'mangle', 'raw', 'nat']: self.add_cmd_output([f"fpcmd nf4-rules {table}"]) # 6wind doesn't care on which bridge the ports are, there's only # one bridge and it's alubr0 port_list = self.collect_cmd_output("fp-cli fp-vswitch-ports") if port_list['status'] == 0: for port in port_list['output'].splitlines(): mport = re.match(r'^([\d]+):[\s]+([^\s]+)', port) if mport: port_name = mport.group(2) self.add_cmd_output([ f"fp-cli dpdk-cp-filter-budget {port_name}", ]) def collect_datapath(self): """ Gather the datapath information for each datapath """ dp_list_result = self.collect_cmd_output(f'{self.actl} dpctl/dump-dps') if dp_list_result['status'] == 0: for dps in dp_list_result['output'].splitlines(): self.add_cmd_output([ f"{self.actl} dpctl/show -s {dps}", f"{self.actl} dpctl/dump-flows -m {dps}", f"{self.actl} dpctl/dump-conntrack -m {dps}", f"{self.actl} dpctl/ct-stats-show -m {dps}", f"{self.actl} dpctl/ipf-get-status {dps}", ]) def collect_ovs_bridge_info(self): """ Gather additional output for each OVS bridge on the host. """ br_list_result = self.collect_cmd_output(f"{self.vctl} -t 5 list-br") if br_list_result['status'] != 0: return for bri in br_list_result['output'].splitlines(): self.add_cmd_output([ f"{self.actl} bridge/dump-flows --offload-stats {bri}", f"{self.actl} dpif/show-dp-features {bri}", f"{self.actl} fdb/show {bri}", f"{self.actl} fdb/stats-show {bri}", f"{self.actl} mdb/show {bri}", f"{self.ofctl} dump-flows {bri}", f"{self.ofctl} dump-ports-desc {bri}", f"{self.ofctl} dump-ports {bri}", f"{self.ofctl} queue-get-config {bri}", f"{self.ofctl} queue-stats {bri}", f"{self.ofctl} show {bri}", f"{self.ofctl} dump-groups {bri}", ]) self.get_flow_versions(bri) self.get_port_list(bri) if self.check_dpdk: iface_list_result = self.exec_cmd( f"{self.vctl} -t 5 list-ifaces {bri}" ) if iface_list_result['status'] == 0: for iface in iface_list_result['output'].splitlines(): self.add_cmd_output( f"{self.actl} netdev-dpdk/get-mempool-info {iface}" ) if self.check_6wind: self.add_cmd_output([ f"{self.actl} evpn/vip-list-show {bri}", f"{self.actl} bridge/dump-conntracks-summary {bri}", f"{self.actl} bridge/acl-table ingress/egress {bri}", f"{self.actl} bridge/acl-table {bri}", f"{self.actl} ofproto/show {bri}", ]) vrf_list = self.collect_cmd_output( f"{self.actl} vrf/list {bri}") if vrf_list['status'] == 0: vrfs = vrf_list['output'].split()[1:] for vrf in vrfs: self.add_cmd_output([ f"{self.actl} vrf/route-table {vrf}", ]) evpn_list = self.collect_cmd_output( f"{self.actl} evpn/list {bri}") if evpn_list['status'] == 0: evpns = evpn_list['output'].split()[1:] for evpn in evpns: self.add_cmd_output([ f"{self.actl} evpn/mac-table {evpn}", f"{self.actl} evpn/arp-table {evpn}", f"{self.actl} evpn/dump-flows {bri} {evpn}", f"{self.actl} evpn/dhcp-pool-show {bri} {evpn}", f"{self.actl} evpn/dhcp-relay-show {bri} {evpn}", f"{self.actl} evpn/dhcp-static-show {bri} {evpn}", f"{self.actl} evpn/dhcp-table-show {bri} {evpn}", f"{self.actl} evpn/proxy-arp-filter-list " f"{bri} {evpn}", f"{self.actl} evpn/show {bri} {evpn}", f"{self.actl} port/dscp-table {bri} {evpn}", ]) def get_flow_versions(self, bridge): """ Collect flow version of the given bridge """ # Flow protocols currently supported flow_versions = [ "OpenFlow10", "OpenFlow11", "OpenFlow12", "OpenFlow13", "OpenFlow14", "OpenFlow15" ] # Flow protocol hex identifiers ofp_versions = { 0x01: "OpenFlow10", 0x02: "OpenFlow11", 0x03: "OpenFlow12", 0x04: "OpenFlow13", 0x05: "OpenFlow14", 0x06: "OpenFlow15", } ofp_ver_result = self.collect_cmd_output(f"{self.vctl} -t 5 --version") # List protocols currently in use, if any br_info = self.collect_cmd_output( f"{self.vctl} -t 5 list bridge {bridge}") br_protos = [] for line in br_info['output'].splitlines(): if "protocols" in line: br_protos_ln = line[line.find("[")+1:line.find("]")] br_protos = br_protos_ln.replace('"', '').split(", ") # If 'list bridge' yeilded no protocols, use the range of # protocols enabled by default on this version of ovs. if br_protos == [''] and ofp_ver_result['output']: ofp_version_range = ofp_ver_result['output'].splitlines() ver_range = [] for line in ofp_version_range: if "OpenFlow versions" in line: ver_sp = line.split("OpenFlow versions ") ver = ver_sp[1].split(":") ver_range = range(int(ver[0], 16), int(ver[1], 16)+1) for protocol in ver_range: if protocol in ofp_versions: br_protos.append(ofp_versions[protocol]) # Collect flow information for relevant protocol versions only for flow in flow_versions: if flow in br_protos: self.add_cmd_output([ f"{self.ofctl} -O {flow} show {bridge}", f"{self.ofctl} -O {flow} dump-groups {bridge}", f"{self.ofctl} -O {flow} dump-group-stats {bridge}", f"{self.ofctl} -O {flow} dump-flows {bridge}", f"{self.ofctl} -O {flow} dump-tlv-map {bridge}", f"{self.ofctl} -O {flow} dump-ports-desc {bridge}", f"{self.ofctl} -O {flow} dump-meters {bridge}", f"{self.ofctl} -O {flow} meter-stats {bridge}", ]) def get_port_list(self, bridge): """ Collect port list of the given bridge """ port_list_result = self.exec_cmd( f"{self.vctl} -t 5 list-ports {bridge}") if port_list_result['status'] == 0: for port in port_list_result['output'].splitlines(): self.add_cmd_output([ f"{self.actl} cfm/show {port}", f"{self.actl} qos/show {port}", # Not all ports are "bond"s, but all "bond"s are # a single port f"{self.actl} bond/show {port}", # In the case of IPSec, we should pull the config f"{self.actl} get Interface {port} options", ]) if self.check_dpdk: self.add_cmd_output( f"{self.actl} netdev-dpdk/get-mempool-info {port}") class RedHatOpenVSwitch(OpenVSwitch, RedHatPlugin): packages = ('openvswitch', 'openvswitch[2-9].*', 'openvswitch-dpdk', 'nuage-openvswitch' '6windgate-fp') class DebianOpenVSwitch(OpenVSwitch, DebianPlugin, UbuntuPlugin): packages = ('openvswitch-switch', 'nuage-openvswitch') files = ( '/var/snap/openstack-hypervisor/common/etc/openvswitch/system-id.conf', ) def setup(self): if self.is_installed('openstack-hypervisor'): self.ovs_cmd_pre = "openstack-hypervisor." self.actl = f"{self.ovs_cmd_pre}{self.actl}" self.vctl = f"{self.ovs_cmd_pre}{self.vctl}" self.ofctl = f"{self.ovs_cmd_pre}{self.ofctl}" self.dpctl = f"{self.ovs_cmd_pre}{self.dpctl}" super().setup() # vim: set et ts=4 sw=4 :
Upload File
Create Folder