如何采用Python zabbix(4)

#!/usr/bin/env python
#-*-coding:utf8-*-
import os,sys,time
workfile = '/home/zabbix/zabbix/sjz/'
def collect_info():
    dict_doc = dict()
    for i in os.listdir(workfile):
        dict_doc[i] = list()
        for v in os.listdir('%s%s' %(workfile,i)):
            dict_doc[i].append(v)
 
    count = 0
    for x,y in dict_doc.items():
        for p in y:
            fp = '%s/%s/%s' %(workfile,x,p)
            op = open(fp,'r').readlines()
            np = '%s.txt' %p
            os.system( """ cat %s|awk -F";" '{print $3}' > %s """ %(fp,np))
            count += 1
    print count
if __name__ == "__main__":
    sc = collect_info()

四,整理数据,汇报成图形,撰写技术报告

一些Zabbix相关教程集合

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ffe942d2ed4265818c07ce4dce4f88b7.html