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

No dashboards detected #13

Open
javiermarcon opened this issue Nov 9, 2015 · 6 comments
Open

No dashboards detected #13

javiermarcon opened this issue Nov 9, 2015 · 6 comments

Comments

@javiermarcon
Copy link

I installed grafana Alerts (grafana_alerts-1.0.0.dev7.tar.gz) with pip and configured it, but it first gave me this error:

javier@javier-System-Product-Name:/prueba/monitoreo$ grafanaalerts []
None
Traceback (most recent call last):
File "/usr/local/bin/grafanaalerts", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/grafana_alerts/init.py", line 12, in main
return the_launcher.launch()
File "/usr/local/lib/python2.7/dist-packages/grafana_alerts/launcher.py", line 16, in launch
alert_checker.check()
File "/usr/local/lib/python2.7/dist-packages/grafana_alerts/alerting.py", line 40, in check
for d in dashboard_data_list:
TypeError: 'NoneType' object is not iterable
javier@javier-System-Product-Name:
/prueba/monitoreo$

I solved it replacing lines 39 and 40 of alerting.py with:

    print dashboard_data_list
    if not dashboard_data_list:
        return
    for d in dashboard_data_list:

But grafanaalerts does not recognize the dashboards, it allways claim that there are no dashboards and I have 2 unstarred dashboards (and no starred dashboards).

@javiermarcon
Copy link
Author

I forgot to mention that if I markthe dashboards as starred, I get the same result. I am using grafana/grafana docker image that runs grafana 2.5 with port 3000 exposed.

The output of grafanaalerts is:

javier@javier-System-Product-Name:/prueba/monitoreo$ grafanaalerts
[]
None
javier@javier-System-Product-Name:
/prueba/monitoreo$

@javiermarcon
Copy link
Author

If I manually run the http query of DashboardScanner::obtain_dashboards() I get:

javier@javier-System-Product-Name:/prueba/monitoreo$ curl -H "Authorization: Bearer eyJrIjoiaGZ6YjNDRzRwdGExQmhnbzhRbEdFQXVxVTZZTzBITHkiLCJuIjoiZ3JhZmFuYS1lZGl0b3IiLCJpZCI6MX0=" http://127.0.0.1:3000/api/search?limit=10&query=&tag=monitored
[1] 17717
[2] 17718
javier@javier-System-Product-Name:
/prueba/monitoreo$ [{"id":1,"title":"Datos de servers","uri":"db/datos-de-servers","type":"dash-db","tags":[],"isStarred":false},{"id":2,"title":"Valores_individuales para uptime robot","uri":"db/valores_individuales-para-uptime-robot","type":"dash-db","tags":[],"isStarred":false}]

@vmironenko
Copy link

I think you didn't mark dashboards with the tag "monitored" : "Dashboards to be monitored for alerts must be marked with the tag "monitored""

@javiermarcon
Copy link
Author

Thanks, I can't find the option to mark the dashboards as monitored. is
there a tutorial?

Thanks,

Javier.

El 13/11/15 a las 00:15, VMironenko escribió:

I think you didn't mark dashboards with the tag "monitored" :
"Dashboards to be monitored for alerts must be marked with the tag
"monitored""


Reply to this email directly or view it on GitHub
#13 (comment).

@moandcompany
Copy link

I think the error is at #160 of alerting.py DashboardScanner.obtain_dashboards() when used with Grafana 2.5.x+

dashboards = jmespath.search('dashboards', data)

The returned object from the DashboardScanner is None because it is searching for a field dashboards that is not contained within the Grafana server response. It is possible this was changed since prior Grafana versions. The relevant field for Grafana 2.5.x+ appears to be "type":"dash-db"

There appear to be a bunch of other field name changes downstream too

Update: many of these errors appear to occur for Grafana 2.0.2+ and later)

@vtaneeru
Copy link

@moandcompany Tried looking for "dash-db". But it didn't work. What field should we look for in json?

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

No branches or pull requests

4 participants