晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /lib/python3.6/site-packages/sos/report/plugins/ |
Upload File : |
# Copyright (C) 2018 Red Hat, Inc. Daniel Walsh <dwalsh@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.
from sos.report.plugins import Plugin, RedHatPlugin, UbuntuPlugin, PluginOpt
class Podman(Plugin, RedHatPlugin, UbuntuPlugin):
"""Podman is a daemonless container management engine, and this plugin is
meant to provide diagnostic information for both the engine and the
containers that podman is managing.
General status information will be collected from podman commands, while
detailed inspections of certain components will provide more insight
into specific container problems. This detailed inspection is provided for
containers, images, networks, and volumes. Per-entity inspections will be
recorded in subdirs within sos_commands/podman/ for each of those types.
"""
short_desc = 'Podman containers'
plugin_name = 'podman'
profiles = ('container',)
packages = ('podman',)
option_list = [
PluginOpt('all', default=False,
desc='collect for all containers, even terminated ones',
long_desc=(
'Enable collection for all containers that exist on the '
'system regardless of their running state. This may cause '
'a significant increase in sos archive size, especially '
'when combined with the \'logs\' option.')),
PluginOpt('logs', default=False,
desc='collect stdout/stderr logs for containers',
long_desc=(
'Capture \'podman logs\' output for discovered containers.'
' This may be useful or not depending on how/if the '
'container produces stdout/stderr output. Use cautiously '
'when also using the \'all\' option.')),
PluginOpt('size', default=False,
desc='collect image sizes for podman ps')
]
def setup(self):
self.add_env_var([
'HTTP_PROXY',
'HTTPS_PROXY',
'NO_PROXY',
'ALL_PROXY'
])
self.add_cmd_tags({
'podman images': 'podman_list_images',
'podman ps': 'podman_list_containers'
})
subcmds = [
'info',
'image trust show',
'images',
'images --digests',
'pod ps',
'port --all',
'ps',
'ps -a',
'stats --no-stream --all',
'version',
'volume ls'
]
self.add_cmd_output([f"podman {s}" for s in subcmds])
# separately grab ps -s as this can take a *very* long time
if self.get_option('size'):
self.add_cmd_output('podman ps -as', priority=100)
self.add_dir_listing([
'/etc/cni',
'/etc/containers'
], recursive=True)
pnets = self.collect_cmd_output('podman network ls',
tags='podman_list_networks')
if pnets['status'] == 0:
nets = [pn.split()[0] for pn in pnets['output'].splitlines()[1:]]
self.add_cmd_output([
f"podman network inspect {net}" for net in nets
], subdir='networks', tags='podman_network_inspect')
containers = [
c[0] for c in self.get_containers(runtime='podman',
get_all=self.get_option('all'))
]
images = self.get_container_images(runtime='podman')
volumes = self.get_container_volumes(runtime='podman')
for container in containers:
self.add_cmd_output(f"podman inspect {container}",
subdir='containers',
tags='podman_container_inspect')
for img in images:
name, img_id = img
insp = name if 'none' not in name else img_id
self.add_cmd_output(f"podman inspect {insp}", subdir='images',
tags='podman_image_inspect')
self.add_cmd_output(
f"podman image tree {insp}",
subdir='images/tree',
tags='podman_image_tree'
)
for vol in volumes:
self.add_cmd_output(f"podman volume inspect {vol}",
subdir='volumes',
tags='podman_volume_inspect')
if self.get_option('logs'):
for con in containers:
self.add_cmd_output(f"podman logs -t {con}",
subdir='containers', priority=50)
def postproc(self):
# Attempts to match key=value pairs inside container inspect output
# for potentially sensitive items like env vars that contain passwords.
# Typically, these will be seen in env elements or similar, and look
# like this:
# "Env": [
# "mypassword=supersecret",
# "container=oci"
# ],
# This will mask values when the variable name looks like it may be
# something worth obfuscating.
env_regexp = r'(?P<var>(pass|key|secret|PASS|KEY|SECRET).*?)=' \
'(?P<value>.*?)"'
self.do_cmd_output_sub('*inspect*', env_regexp,
r'\g<var>=********"')
# vim: set et ts=4 sw=4 :