initial
commit
51ace626ce
|
@ -0,0 +1,17 @@
|
|||
import requests as r
|
||||
import json
|
||||
from sys import argv
|
||||
|
||||
URL = 'http://graphite.hackerspace.pl/dashboard/load/%s'
|
||||
|
||||
dash = r.get(URL % argv[1]).json
|
||||
|
||||
out = {}
|
||||
|
||||
for n, g in enumerate(dash['state']['graphs']):
|
||||
url = g[2] + '&format=json'
|
||||
title = g[1].get('title', 'Graph ' + str(n))
|
||||
parent = '#graph_div_' + str(n)
|
||||
out[title] = dict(source=url, TimeSeries=dict(parent=parent, title=title))
|
||||
|
||||
print json.dumps(out, indent=2)
|
Loading…
Reference in New Issue