discover.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:docker-monitoring-zabbix-agent 作者: digiapulssi 项目源码 文件源码
def multi_stat_check(args, filename):
    dict = {}
    try:
        with open(args.container + "/" + filename, "r") as f:
            for line in f:
                m = _STAT_RE.match(line)
                if m:
                    dict[m.group(1)] = m.group(2)
    except Exception, e:
        if not os.path.isdir(args.container):
            os.mkdir(args.container)
        debug(args.container + ": could not get last stats from " + filename)
        debug(str(e))

        # first time running for this container create empty file
        open(args.container + "/" + filename,"w").close()
    return dict
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号