zabbix_api.py 文件源码

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

项目:zabbix_manager 作者: BillWang139967 项目源码 文件源码
def __history_get(self,history,item_ID,time_from,time_till): 
        '''
        ????
        ???? item  ??????? history ?
        '''
        history_data=[]
        history_data[:]=[]
        response=self.zapi.history.get({
                 "time_from":time_from,
                 "time_till":time_till,
                 "output": "extend",
                 "history": history,
                 "itemids": item_ID,
                 "sortfield":"clock",
                 "limit": 10080
            })
        if len(response) == 0:
            warn_msg("not have history_data")
            debug_info=str([history,item_ID,time_from,time_till,"####not have history_data"])
            self.logger.debug(debug_info)
            return 0.0
        for history_info in response:
            timeArray = time.localtime(int(history_info['clock']))
            otherStyleTime = time.strftime("%Y-%m-%d %H:%M:%S", timeArray)
            print(item_ID,history_info['value'],otherStyleTime)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号