zabbix_handler.py 文件源码

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

项目:zcp 作者: apolloliu 项目源码 文件源码
def contact_zabbix_server(self, payload):
        """
        Method used to contact the Zabbix server.

        :param payload: refers to the json message to send to Zabbix
        :return: returns the response from the Zabbix API
        """
        data = json.dumps(payload)
        req = urllib2.Request('http://' + self.zabbix_host +
                              '/zabbix/api_jsonrpc.php',
                              data,
                              {'Content-Type': 'application/json'})
        f = urllib2.urlopen(req)
        response = json.loads(f.read())
        f.close()
        return response
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号