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
评论列表
文章目录