PATH:
usr
/
lib
/
python3.9
/
site-packages
/
sos
/
report
/
plugins
# Copyright (C) 2016 Red Hat, Inc., Pep Turro Mauri <pep@redhat.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. import os.path from sos.report.plugins import Plugin, RedHatPlugin # This plugin collects static configuration and runtime information # about OpenShift Origin based environments, like OpenShift Enterprise 3 # Some clarification on naming: # OpenShift Origin is the upstream project for OpenShift Enterprise, # OpenShift Container Platflorm, and Atomic Platform. # # However, the name "OpenShift Origin" refers to two different code bases: # * Origin M5 and later (https://github.com/openshift/origin) # which is upstream for OpenShift 3.x and later. # This is what this plugin handles # * Origin M4 and earlier (https://github.com/openshift/origin-server) # which is upstream for OpenShift 1.x and 2.x. # This is handled by the plugin in openshift.py # Note that this plugin should be used in conjunction with other plugins # in order to capture relevant data: the Kubernetes plugin for the # masters, the Docker plugin for the nodes, and also generic # plugins (e.g. for /etc/sysconfig entries, network setup etc) class OpenShiftOrigin(Plugin): short_desc = 'OpenShift Origin' plugin_name = "origin" files = None # file lists assigned after path setup below profiles = ('openshift',) master_base_dir = "/etc/origin/master" node_base_dir = "/etc/origin/node" master_cfg = os.path.join(master_base_dir, "master-config.yaml") master_env = os.path.join(master_base_dir, "master.env") node_cfg_file = "node-config.yaml" node_cfg = os.path.join(node_base_dir, node_cfg_file) node_kubeconfig = os.path.join(node_base_dir, "node.kubeconfig") static_pod_dir = os.path.join(node_base_dir, "pods") files = (master_cfg, node_cfg) # Master vs. node # # OpenShift Origin/3.x cluster members can be a master, a node, or both at # the same time: in most deployments masters are also nodes in order to get # access to the pod network, which some functionality (e.g. the API proxy) # requires. Therefore the following methods may all evaluate True on a # single instance (at least one must evaluate True if this is an OpenShift # installation) def is_master(self): """Determine if we are on a master""" return self.path_exists(self.master_cfg) def is_node(self): """Determine if we are on a node""" return self.path_exists(self.node_cfg) def is_static_etcd(self): """Determine if we are on a node running etcd""" return self.path_exists(self.path_join(self.static_pod_dir, "etcd.yaml")) def is_static_pod_compatible(self): """Determine if a node is running static pods""" return self.path_exists(self.static_pod_dir) def setup(self): bstrap_node_cfg = self.path_join(self.node_base_dir, "bootstrap-" + self.node_cfg_file) bstrap_kubeconfig = self.path_join(self.node_base_dir, "bootstrap.kubeconfig") node_certs = self.path_join(self.node_base_dir, "certs", "*") node_client_ca = self.path_join(self.node_base_dir, "client-ca.crt") admin_cfg = self.path_join(self.master_base_dir, "admin.kubeconfig") oc_cmd_admin = f"oc --config={admin_cfg}" static_pod_logs_cmd = "master-logs" # Note that a system can run both a master and a node. # See "Master vs. node" above. if self.is_master(): self.add_copy_spec([ self.master_cfg, self.master_env, self.path_join(self.master_base_dir, "*.crt"), ]) if self.is_static_pod_compatible(): self.add_copy_spec(self.path_join(self.static_pod_dir, "*.yaml")) self.add_cmd_output([ f"{static_pod_logs_cmd} api api", f"{static_pod_logs_cmd} controllers controllers", ]) if self.is_static_etcd(): self.add_cmd_output(f"{static_pod_logs_cmd} etcd etcd") # Possible enhancements: # some thoughts about information that might also be useful # to collect. However, these are maybe not needed in general # and/or present some challenges (scale, sensitive, ...) and need # some more thought. For now just leaving this comment here until # we decide if it's worth collecting: # # General project status: # oc status --all-namespaces (introduced in OSE 3.2) # -> deemed as not worthy in BZ#1394527 # Metrics deployment configurations # oc get -o json dc -n openshift-infra # Logging stack deployment configurations # oc get -o json dc -n logging # # Note: Information about nodes, events, pods, and services # is already collected by the Kubernetes plugin subcmds = [ "adm top images", "adm top imagestreams", "adm top nodes" ] self.add_cmd_output([ f'{oc_cmd_admin} {subcmd}' for subcmd in subcmds ]) jcmds = [ "hostsubnet", "clusternetwork", "netnamespaces" ] self.add_cmd_output([ f'{oc_cmd_admin} get -o json {jcmd}' for jcmd in jcmds ]) nmsps = [ 'default', 'openshift-web-console', 'openshift-ansible-service-broker', 'openshift-sdn', 'openshift-console' ] self.add_cmd_output([ f'{oc_cmd_admin} get -o json deploymentconfig,deployment,' f'daemonsets -n {n}' for n in nmsps ]) if not self.is_static_pod_compatible(): self.add_journal(units=["atomic-openshift-master", "atomic-openshift-master-api", "atomic-openshift-master-controllers"]) # get logs from the infrastructure pods running in the default ns pods = self.exec_cmd(f"{oc_cmd_admin} get pod -o name -n default") for pod in pods['output'].splitlines(): self.add_cmd_output(f"{oc_cmd_admin} logs -n default {pod}") # Note that a system can run both a master and a node. # See "Master vs. node" above. if self.is_node(): self.add_copy_spec([ self.node_cfg, self.node_kubeconfig, node_certs, node_client_ca, bstrap_node_cfg, bstrap_kubeconfig, self.path_join(self.node_base_dir, "*.crt"), self.path_join(self.node_base_dir, "resolv.conf"), self.path_join(self.node_base_dir, "node-dnsmasq.conf"), ]) self.add_journal(units="atomic-openshift-node") def postproc(self): # Clear env values from objects that can contain sensitive data # Sample JSON content: # { # "name": "MYSQL_PASSWORD", # "value": "mypassword" # }, # This will mask values when the "name" looks susceptible of # values worth obfuscating, i.e. if the name contains strings # like "pass", "pwd", "key" or "token". env_regexp = r'(?P<var>{\s*"name":\s*[^,]*' \ r'(pass|pwd|key|token|cred|secret' \ r'|PASS|PWD|KEY|TOKEN|CRED|SECRET)[^,]*,' \ r'\s*"value":)[^}]*' self.do_cmd_output_sub('oc*json', env_regexp, r'\g<var> "********"') # LDAP identity provider (bindPassword) # and github/google/OpenID identity providers (clientSecret) self.do_file_sub(self.master_cfg, r"(bindPassword|clientSecret):\s*(.*)", r'\1:"********"') class AtomicOpenShift(OpenShiftOrigin, RedHatPlugin): short_desc = 'OpenShift Enterprise / OpenShift Container Platform' packages = ('atomic-openshift',) # vim: set et ts=4 sw=4 :
[+]
..
[-] freeipmi.py
[edit]
[-] chrony.py
[edit]
[-] crio.py
[edit]
[-] multipath.py
[edit]
[-] cman.py
[edit]
[-] lxd.py
[edit]
[-] xdp.py
[edit]
[-] monit.py
[edit]
[-] rabbitmq.py
[edit]
[-] ssh.py
[edit]
[-] cockpit.py
[edit]
[-] ctdb.py
[edit]
[-] omsa.py
[edit]
[-] named.py
[edit]
[-] ceph_mds.py
[edit]
[-] fibrechannel.py
[edit]
[-] openstack_database.py
[edit]
[-] oddjob.py
[edit]
[-] rhui_containerized.py
[edit]
[-] container_log.py
[edit]
[-] postgresql.py
[edit]
[-] tigervnc.py
[edit]
[-] krb5.py
[edit]
[-] drbd.py
[edit]
[-] procenv.py
[edit]
[-] zfs.py
[edit]
[-] kubernetes.py
[edit]
[-] rpmostree.py
[edit]
[-] wireless.py
[edit]
[-] veritas.py
[edit]
[-] s390.py
[edit]
[-] kvm.py
[edit]
[-] udev.py
[edit]
[-] nis.py
[edit]
[-] canonical_livepatch_onprem.py
[edit]
[-] hpssm.py
[edit]
[-] boom.py
[edit]
[-] foreman.py
[edit]
[-] firewalld.py
[edit]
[-] ovirt.py
[edit]
[-] ubuntu.py
[edit]
[-] redis.py
[edit]
[-] aap_containerized.py
[edit]
[-] openstack_masakarimonitors.py
[edit]
[-] console.py
[edit]
[-] sas3ircu.py
[edit]
[-] ebpf.py
[edit]
[-] kernel.py
[edit]
[-] openstack_ironic.py
[edit]
[-] ostree.py
[edit]
[-] charmed_mysql.py
[edit]
[-] system.py
[edit]
[-] salt.py
[edit]
[-] ceph_mon.py
[edit]
[-] validation_framework.py
[edit]
[-] ppp.py
[edit]
[-] md.py
[edit]
[-] docker.py
[edit]
[-] ldap.py
[edit]
[-] kpatch.py
[edit]
[-] valkey.py
[edit]
[-] gluster.py
[edit]
[-] microovn.py
[edit]
[-] nodejs.py
[edit]
[-] shmcli.py
[edit]
[-] openstack_heat.py
[edit]
[-] azure.py
[edit]
[-] teamd.py
[edit]
[-] mellanox_firmware.py
[edit]
[-] kdump.py
[edit]
[-] openstack_sahara.py
[edit]
[-] navicli.py
[edit]
[-] opendaylight.py
[edit]
[-] microcloud.py
[edit]
[-] udisks.py
[edit]
[-] ovirt_hosted_engine.py
[edit]
[-] dhcp.py
[edit]
[-] lustre.py
[edit]
[-] kimchi.py
[edit]
[-] tftpserver.py
[edit]
[-] dovecot.py
[edit]
[-] mvcli.py
[edit]
[-] foreman_installer.py
[edit]
[-] cobbler.py
[edit]
[-] microshift.py
[edit]
[-] opensearch.py
[edit]
[-] snapm.py
[edit]
[-] ceph_common.py
[edit]
[-] pulpcore.py
[edit]
[-] charmed_postgresql.py
[edit]
[-] etcd.py
[edit]
[-] openvswitch.py
[edit]
[-] rhui.py
[edit]
[-] openstack_horizon.py
[edit]
[-] skydive.py
[edit]
[-] nvmetcli.py
[edit]
[-] bird.py
[edit]
[-] oratab.py
[edit]
[-] rhcos.py
[edit]
[-] symcli.py
[edit]
[-] seagate_ses.py
[edit]
[-] openstack_instack.py
[edit]
[-] npm.py
[edit]
[-] ntb.py
[edit]
[-] openstack_edpm.py
[edit]
[-] smclient.py
[edit]
[-] ovn_host.py
[edit]
[-] cifs.py
[edit]
[-] boot.py
[edit]
[-] devices.py
[edit]
[-] unity.py
[edit]
[-] systemtap.py
[edit]
[-] rhc.py
[edit]
[-] firewall_tables.py
[edit]
[-] omnipath_manager.py
[edit]
[-] systemd.py
[edit]
[-] ovirt_imageio.py
[edit]
[-] dracut.py
[edit]
[-] snap.py
[edit]
[-] mysql.py
[edit]
[-] ultrapath.py
[edit]
[-] cs.py
[edit]
[-] autofs.py
[edit]
[-] date.py
[edit]
[-] ceph_osd.py
[edit]
[-] xen.py
[edit]
[-] stratis.py
[edit]
[-] slurm.py
[edit]
[-] sudo.py
[edit]
[-] pam.py
[edit]
[-] openstack_neutron.py
[edit]
[-] perccli2.py
[edit]
[-] vhostmd.py
[edit]
[-] perccli.py
[edit]
[-] rasdaemon.py
[edit]
[-] snapper.py
[edit]
[-] landscape.py
[edit]
[-] pci.py
[edit]
[-] libvirt.py
[edit]
[-] squid.py
[edit]
[-] activemq.py
[edit]
[-] apport.py
[edit]
[-] opencl.py
[edit]
[-] nfsganesha.py
[edit]
[-] rhv_analyzer.py
[edit]
[-] hts.py
[edit]
[-] ceph_mgr.py
[edit]
[-] grafana.py
[edit]
[-] manageiq.py
[edit]
[-] sos_extras.py
[edit]
[-] filesys.py
[edit]
[-] subscription_manager.py
[edit]
[-] mpt.py
[edit]
[-] aap_hub.py
[edit]
[-] microk8s.py
[edit]
[-] openstack_aodh.py
[edit]
[-] openstack_ansible.py
[edit]
[-] sunbeam.py
[edit]
[-] rpm.py
[edit]
[-] openstack_barbican.py
[edit]
[-] snmp.py
[edit]
[-] anaconda.py
[edit]
[-] unpackaged.py
[edit]
[-] ceph_ansible.py
[edit]
[-] telegraf.py
[edit]
[-] ruby.py
[edit]
[-] __init__.py
[edit]
[-] xinetd.py
[edit]
[-] smartcard.py
[edit]
[-] jars.py
[edit]
[-] watchdog.py
[edit]
[-] collectd.py
[edit]
[-] dlm.py
[edit]
[-] infinidat.py
[edit]
[-] apache.py
[edit]
[-] os_net_config.py
[edit]
[-] ipvs.py
[edit]
[-] arcconf.py
[edit]
[-] services.py
[edit]
[-] block.py
[edit]
[-] openssl.py
[edit]
[-] sar.py
[edit]
[-] nss.py
[edit]
[-] saltmaster.py
[edit]
[-] processor.py
[edit]
[-] megacli.py
[edit]
[-] ufw.py
[edit]
[-] curtin.py
[edit]
[-] foreman_proxy.py
[edit]
[-] ansible.py
[edit]
[-] vulkan.py
[edit]
[-] pulseaudio.py
[edit]
[-] distupgrade.py
[edit]
[-] powerpc.py
[edit]
[-] btrfs.py
[edit]
[-] composer.py
[edit]
[-] sunbeam_hypervisor.py
[edit]
[-] fail2ban.py
[edit]
[-] x11.py
[edit]
[-] convert2rhel.py
[edit]
[-] openstack_masakari.py
[edit]
[-] apparmor.py
[edit]
[-] mongodb.py
[edit]
[-] openstack_nova.py
[edit]
[-] openstack_cinder.py
[edit]
[-] spyre.py
[edit]
[-] collectl.py
[edit]
[-] anacron.py
[edit]
[-] tomcat.py
[edit]
[-] conntrack.py
[edit]
[-] juju.py
[edit]
[-] ovirt_node.py
[edit]
[-] sendmail.py
[edit]
[-] i18n.py
[edit]
[-] proxmox.py
[edit]
[-] nfs.py
[edit]
[-] login.py
[edit]
[-] postfix.py
[edit]
[-] containerd.py
[edit]
[-] lvm2.py
[edit]
[-] ptp.py
[edit]
[-] apt.py
[edit]
[-] aap_receptor.py
[edit]
[-] usbguard.py
[edit]
[-] python.py
[edit]
[-] ovirt_provider_ovn.py
[edit]
[-] grub2.py
[edit]
[-] iscsi.py
[edit]
[-] dbus.py
[edit]
[-] ceph_iscsi.py
[edit]
[-] radius.py
[edit]
[-] aide.py
[edit]
[-] cxl.py
[edit]
[-] ds.py
[edit]
[-] sanlock.py
[edit]
[-] openstack_octavia.py
[edit]
[-] loki.py
[edit]
[-] pcp.py
[edit]
[-] opencontrail.py
[edit]
[-] sysvipc.py
[edit]
[-] vdo.py
[edit]
[-] dnf.py
[edit]
[-] mssql.py
[edit]
[-] acpid.py
[edit]
[-] process.py
[edit]
[-] pmem.py
[edit]
[-] kafka.py
[edit]
[-] openhpi.py
[edit]
[-] dpkg.py
[edit]
[-] hpasm.py
[edit]
[-] podman.py
[edit]
[-] targetcli.py
[edit]
[-] omnipath_client.py
[edit]
[-] containers_common.py
[edit]
[-] lilo.py
[edit]
[-] hyperv.py
[edit]
[-] selinux.py
[edit]
[-] ntp.py
[edit]
[-] zvm.py
[edit]
[-] openstack_tripleo.py
[edit]
[-] lightdm.py
[edit]
[-] cgroups.py
[edit]
[-] opensvc.py
[edit]
[-] origin.py
[edit]
[-] kernelrt.py
[edit]
[-] cups.py
[edit]
[-] coredump.py
[edit]
[-] fwupd.py
[edit]
[-] auditd.py
[edit]
[-] peripety.py
[edit]
[-] grub.py
[edit]
[-] libreswan.py
[edit]
[-] saphana.py
[edit]
[-] nvme.py
[edit]
[-] gssproxy.py
[edit]
[-] nvidia.py
[edit]
[-] openstack_keystone.py
[edit]
[-] greenboot.py
[edit]
[-] bcache.py
[edit]
[-] host.py
[edit]
[-] canonical_livepatch.py
[edit]
[-] qt.py
[edit]
[-] haproxy.py
[edit]
[-] keepalived.py
[edit]
[-] nscd.py
[edit]
[-] dellrac.py
[edit]
[-] virtwho.py
[edit]
[-] flatpak.py
[edit]
[-] helm.py
[edit]
[-] java.py
[edit]
[-] rear.py
[edit]
[-] numa.py
[edit]
[-] ovirt_engine_backup.py
[edit]
[-] storageconsole.py
[edit]
[-] ipmitool.py
[edit]
[-] qpid_dispatch.py
[edit]
[-] gdm.py
[edit]
[-] microshift_ovn.py
[edit]
[-] libraries.py
[edit]
[-] kata_containers.py
[edit]
[-] gfs2.py
[edit]
[-] xfs.py
[edit]
[-] openstack_placement.py
[edit]
[-] hardware.py
[edit]
[-] dmraid.py
[edit]
[-] cloud_init.py
[edit]
[-] memory.py
[edit]
[-] fcoe.py
[edit]
[-] puppet.py
[edit]
[-] openstack_designate.py
[edit]
[-] elastic.py
[edit]
[-] ceph_rgw.py
[edit]
[-] psacct.py
[edit]
[-] migration_results.py
[edit]
[-] virsh.py
[edit]
[-] logrotate.py
[edit]
[-] devicemapper.py
[edit]
[-] release.py
[edit]
[-] storcli.py
[edit]
[-] openstack_manila.py
[edit]
[-] openshift_ovn.py
[edit]
[-] sssd.py
[edit]
[-] docker_distribution.py
[edit]
[-] quagga.py
[edit]
[-] openstack_ceilometer.py
[edit]
[-] vsftpd.py
[edit]
[-] maas.py
[edit]
[-] alternatives.py
[edit]
[-] instructlab.py
[edit]
[-] vmware.py
[edit]
[-] aap_gateway.py
[edit]
[-] foreman_openscap.py
[edit]
[-] qaucli.py
[edit]
[-] cron.py
[edit]
[-] logs.py
[edit]
[-] iscsitarget.py
[edit]
[-] candlepin.py
[edit]
[-] openstack_novajoin.py
[edit]
[-] pulp.py
[edit]
[-] infiniband.py
[edit]
[-] openshift.py
[edit]
[-] clear_containers.py
[edit]
[-] soundcard.py
[edit]
[-] openstack_gnocchi.py
[edit]
[-] ipa.py
[edit]
[-] perl.py
[edit]
[-] bootc.py
[edit]
[-] authd.py
[edit]
[-] ssmtp.py
[edit]
[-] openstack_mistral.py
[edit]
[+]
__pycache__
[-] qpid.py
[edit]
[-] openstack_swift.py
[edit]
[-] aws.py
[edit]
[-] memcached.py
[edit]
[-] vectordev.py
[edit]
[-] ata.py
[edit]
[-] iprconfig.py
[edit]
[-] networking.py
[edit]
[-] usb.py
[edit]
[-] insights.py
[edit]
[-] aap_controller.py
[edit]
[-] tuned.py
[edit]
[-] corosync.py
[edit]
[-] scsi.py
[edit]
[-] gluster_block.py
[edit]
[-] sapnw.py
[edit]
[-] samba.py
[edit]
[-] gcp.py
[edit]
[-] keyutils.py
[edit]
[-] vault.py
[edit]
[-] buildah.py
[edit]
[-] crypto.py
[edit]
[-] kea.py
[edit]
[-] openstack_glance.py
[edit]
[-] nginx.py
[edit]
[-] frr.py
[edit]
[-] aap_eda.py
[edit]
[-] sunrpc.py
[edit]
[-] fapolicyd.py
[edit]
[-] ovn_central.py
[edit]
[-] tpm2.py
[edit]
[-] sedutil.py
[edit]
[-] opengl.py
[edit]
[-] discovery.py
[edit]
[-] openstack_trove.py
[edit]
[-] lstopo.py
[edit]
[-] pacemaker.py
[edit]
[-] leapp.py
[edit]
[-] vdsm.py
[edit]
[-] unbound.py
[edit]
[-] networkmanager.py
[edit]
[-] powerpath.py
[edit]
[-] abrt.py
[edit]