mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
in plugin ceph-osd-info, if retrieving the data fails, retry up to 10 times
This commit is contained in:
parent
0d5391f903
commit
974e8cf08c
1 changed files with 11 additions and 9 deletions
|
@ -92,15 +92,17 @@ settings_graph={
|
||||||
subgraphs=True
|
subgraphs=True
|
||||||
|
|
||||||
def read_osd(filename):
|
def read_osd(filename):
|
||||||
s=socket.socket(socket.AF_UNIX,socket.SOCK_STREAM)
|
for loop in range(10):
|
||||||
s.connect(filename)
|
try:
|
||||||
s.send("{\"prefix\": \"perf dump\"}\0")
|
s=socket.socket(socket.AF_UNIX,socket.SOCK_STREAM)
|
||||||
result=s.recv(102400)
|
s.connect(filename)
|
||||||
result=result[4:]
|
s.send("{\"prefix\": \"perf dump\"}\0")
|
||||||
try:
|
result=s.recv(102400)
|
||||||
return json.loads(result)
|
result=result[4:]
|
||||||
except:
|
return json.loads(result)
|
||||||
print >> sys.stderr, "Result from %s: %s" % (filename,result)
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def osd_list():
|
def osd_list():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue