mon.py 文件源码

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

项目:cephmetrics 作者: ceph 项目源码 文件源码
def post_event(url, tag_name, event_message):

        headers = {"Content-Type": "application/json"}

        try:
            r = requests.post(url,
                              headers=headers,
                              data='{{"what":"Ceph Health",'
                                   '"tags":"{}",'
                                   '"data":"{}"}}'.format(tag_name,
                                                          event_message))
        except requests.ConnectionError:
            # if we hit this, the endpoint wasn't there (graphite web was not
            # accessible) so identify that issue as a server error (500)
            return 500

        else:
            return r.status_code
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号