New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance cron_grafana (add argument to force recreate dashboard and li… #251
Conversation
5440bf5
to
4b35664
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments and a question
items = hosts_db.find({'ls_grafana': False, '_realm': {"$in": children}, | ||
'ls_perf_data': {"$ne": ""}, '_is_template': False}) | ||
search['_realm'] = {"$in": children} | ||
items = hosts_db.find(search) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more need to include _is_template
? It will generate a dashboard for the templates also, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this comment ... I got it 😉
@@ -1753,28 +1762,40 @@ def cron_grafana(engine='jsonify'): | |||
if graf.connection: | |||
# get the realms of the grafana | |||
realm = realm_db.find_one({'_id': grafana['_realm']}) | |||
search = {'_realm': realm['_id'], '_is_template': False} | |||
if forcegenerate is not None: | |||
print("[cron_grafana] Force generation of grafana dashboard") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please indicate which grafana instance is concerned
I am currently testing on my server and I will probably commit some small modifications soon... |
c6db424
to
61305ff
Compare
I made many modifications to improve the dashboard building and I tested with the demo configuration on my own test servers with graphite / statsd / grafana ... great results! |
- add a parameter to force rebuilding the dashboards Improve Grafana dashboard creation: - add some prints to get logs - improve DB requests - set datasource name as alignak-source-name instead of _id - sanitize metrics name - add templating in dahsboard for the stats/graphite prefixs - improve metric target build: variables, alias - add series override for legend and color - set ref and label for warning/critical/min/max
d1a2ed6
to
b866e4f
Compare
…mit this endpoint to localhost)