uec@sddlmZmZmZmZmZddlmZddlm Z defdYZ de efdYZ de eefd YZ d S( i(tPlugint RedHatPlugint UbuntuPlugint DebianPlugint SoSPredicate(tlistdir(tmatcht NetworkingcBseZdZdZdZdZddedefd d d d d dfdddddfddddefdddefgZdZ dZ dZ dZ dZ RS(s%network and device configuration t networkingtnetworkthardwaretsystemswww.example.comt traceroutescollect a traceroute to %stslowtnamespace_patterns"Specific namespaces pattern to be s@collected, namespaces pattern should be separated by whitespace sas for example "eth* ens2"tfasttt namespacess2Number of namespaces to collect, 0 for unlimited. s5Incompatible with the namespace_pattern plugin optionitethtool_namespacess%Define if ethtool commands should be scollected for namespacest eepromdumps$collect 'ethtool -e' for all devicess-WcCs>d|}d|d}|j|dt|d|gdS(sB When running the iptables command, it unfortunately auto-loads the modules before trying to get output. Some people explicitly don't want this, so check if the modules are loaded before running the command. If they aren't loaded, there can't possibly be any relevant rules in that table tiptable_s iptables -t s -nvLtpredtkmodsN(tadd_cmd_outputR(tselft tablenametmodnametcmd((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pytcollect_iptable%s cCs>d|}d|d}|j|dt|d|gdS(s& Same as function above, but for ipv6 t ip6table_s ip6tables -t s -nvLRRN(RR(RRRR((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pytcollect_ip6table0s cCs&|jddt|ddgdS(sS Collects nftables rulesets with 'nft' commands if the modules are present snft list rulesetRRt nf_tablesN(RR(R((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pytcollect_nftables7scCsAtt|j|jddddddddd d d d d ddddg|jddddddg|jddd|jddd|jdytdj}Wntk rd}nXx!|j D]}|j |qWytd j}Wntk r(d}nXx!|j D]}|j |q6W|j |jd!|j dd"|jd#d$|j d%d&d'd(d)d*d+d,d-d.d/d0d1gd2}t|d3d4g}|j|d5|d6td7}t|d3d8d9d:d;d<d=gd>id?d36}|j|d5|d6t|jd@d5t|d3dAg|jdBd5t|d3dCgxtdDD]}|dEkrqn|jdF|dG|dH|dI|dJ|dK|dL|dM|dN|dO|dP|dQ|dR|dS|g|jdTrdU|}|jdV||j|qqW|jdWdXdYdZg|jd[r|jd\|jn|jd]} d^} | d_d`kr=g} |jdardbdcj|jdajjddde} nx| dfj D]} | jdgs| js| dh jr>qn|jdartt| | r | j| jdid`q q|jdjd`kr| j| jdid`t| |jdjkr |jdkdl|jdjPq q| j| jdid`qWx~| D]v}| |di}|j|dm|d%|dn|d!|j |d#|d$|j g|d7}|j|d5|qW|jdor=x| D]}| |di}|j|dp}xc|dfj D]Q}|dEkrqn|j|dF||dH||dI||dJ|gqWqWq=ndS(qNs /proc/net/s/etc/nsswitch.confs /etc/yp.confs/etc/inetd.confs/etc/xinetd.confs /etc/xinetd.ds /etc/host*s/etc/resolv.confs /etc/network*s /etc/nftabless/etc/sysconfig/nftables.confs/etc/nftables.confs /etc/dnsmasq*s!/sys/class/net/*/device/numa_nodes/sys/class/net/*/flagss/sys/class/net/*/statistics/s /etc/iproute2s/proc/net/rpc/use-gss-proxys/proc/net/rpc/*/channels/proc/net/rpc/*/flushs /proc/net/cdps /sys/net/cdps/proc/net/eicons ip -o addrt root_symlinktip_addrsroute -ntroutet plotnetcfgs/proc/net/ip_tables_namessnat mangle filter s/proc/net/ip6_tables_namessnetstat %s -neopatnetstats netstat -ssnetstat %s -agnsip route show table allsip -6 route show table alls ip -4 rules ip -6 rules ip -s -d links ip -d addresss ifenslave -asip mroute shows ip maddr showsip -s -s neigh showsip neigh show nud noarpsbiosdevname -dstc -s qdisc showsip -s macsec showRtmacsecRtchangess ss -peaonmittcp_diagtudp_diagt inet_diagt unix_diagt netlink_diagtaf_packet_diagtrequiredtallsiptables -vnxLtiptable_filtersip6tables -vnxLtip6table_filters/sys/class/net/tbonding_masterssethtool s ethtool -d s ethtool -i s ethtool -k s ethtool -S s ethtool -T s ethtool -a s ethtool -c s ethtool -g s ethtool -P s ethtool -l sethtool --phy-statistics sethtool --show-priv-flags sethtool --show-eee Rs ethtool -e %ssWARNING (about to collect '%s'): collecting an eeprom dump is known to cause certain NIC drivers (e.g. bnx2x/tg3) to interrupt device operationsbridge -s -s -d link showsbridge -s -s -d -t fdb showsbridge -s -s -d -t mdb showsbridge -d vlan showR s/bin/traceroute -n %ssip netnssip netns exec tstatusiRs(?:%s$)s$|t*s.*toutputsObject "netns" is unknownit RsLimiting namespace iteration sto first %s namespaces foundsip address shows iptables-saveRsls -1 /sys/class/net/( tsuperRtsetupt add_copy_spectadd_forbidden_pathRtopentreadtIOErrort splitlinesRRR tns_wideRtTrueRt get_optiont _log_warnt trace_hosttcollect_cmd_outputtjointsplittreplacet startswithtisspacetboolRtappendt partitiontlentexec_cmd(Rtip_tables_namesttabletip_macsec_show_cmdt macsec_predtss_cmdtss_predtethRtip_netnst cmd_prefixtout_nstpatterntlinet namespacet ns_cmd_prefixtnetns_netdev_list((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pyR8@s4                             (R R ssystem(t__name__t __module__t__doc__t plugin_nametprofilesRCtFalseR@t option_listR?RRR R8(((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pyRs&      tRedHatNetworkingcBseZdZdZRS(srhn.redhat.comcCsky@|jjjd}t|dddkr?d|_nWntk rSnXtt|jdS(Ns net-toolstversioniis-T( tpolicytpackage_managertall_pkgstintR?t ExceptionR7ReR8(Rt netstat_pkg((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pyR8%s (R^R_RCR8(((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pyRe"stUbuntuNetworkingcBseZdZdZRS(sarchive.ubuntu.comc Cs{tt|j|jddddddddd d g |jd d g|jd rw|jd|jndS(Ns/etc/resolvconfs/etc/network/interfacess/etc/network/interfaces.ds/etc/ufws/var/log/ufw.Logs/etc/resolv.confs/run/netplan/*.yamls/etc/netplan/*.yamls/lib/netplan/*.yamls/run/systemd/networks/usr/sbin/ufw statuss/usr/sbin/ufw app listR s/usr/sbin/traceroute -n %s(R7RmR8R9RRARC(R((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pyR86s"  (R^R_RCR8(((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pyRm3sN( t sos.pluginsRRRRRtosRtreRRReRm(((s:/usr/lib/python2.7/site-packages/sos/plugins/networking.pyt s (