Skip to content
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

Merged
merged 1 commit into from Jan 19, 2017

Conversation

ddurieux
Copy link
Contributor

…mit this endpoint to localhost)

Copy link
Collaborator

@mohierf mohierf left a 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)
Copy link
Collaborator

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?

Copy link
Collaborator

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")
Copy link
Collaborator

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

@mohierf
Copy link
Collaborator

mohierf commented Jan 18, 2017

I am currently testing on my server and I will probably commit some small modifications soon...

@mohierf mohierf force-pushed the develop+cron_grafana_enhance branch 3 times, most recently from c6db424 to 61305ff Compare January 18, 2017 22:26
@mohierf
Copy link
Collaborator

mohierf commented Jan 18, 2017

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
@mohierf mohierf force-pushed the develop+cron_grafana_enhance branch from d1a2ed6 to b866e4f Compare January 19, 2017 10:23
@coveralls
Copy link

coveralls commented Jan 19, 2017

Coverage Status

Coverage increased (+0.6%) to 47.126% when pulling b866e4f on develop+cron_grafana_enhance into 434c41e on develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants