parvez / snapshot

Report Generation for ElasticSearch Kibana / Grafana
54 stars 18 forks source link

- [please update so it also works with Grafana ] Feature request #2

Closed hamelsveld closed 8 years ago

hamelsveld commented 8 years ago

Hi,

Can you also make it work with Grafana? :)

parvez commented 8 years ago

Just tested it locally using online demo from grafana. Wait for the update! đź‘Ť

parvez commented 8 years ago

20160706092634 - grafana - table panel showcase

hamelsveld commented 8 years ago

Cool,

Cant wait :)

tnx

On 06 Jul 2016, at 11:27, Parvez notifications@github.com wrote:

https://cloud.githubusercontent.com/assets/126749/16613485/35ef0106-4321-11e6-867b-a454422f2f63.png — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot_for_kibana/issues/2#issuecomment-230723049, or mute the thread https://github.com/notifications/unsubscribe/APY-AL65C01_YJ9GXooMsicHJug48rBZks5qS3UTgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

Just checked in. I tested using this configuration:

...
  "type": {
    "kibana": false,
    "grafana": true
  },
  "dashboard_url": "http://play.grafana.org/dashboard/",
  "dashboards_list_url": "http://play.grafana.org/api/search",
...

Please help give a shoutout at the grafana github related to this feature request. Enjoy!

hamelsveld commented 8 years ago

tnx I’m going to build and test :)

On 06 Jul 2016, at 12:29, Parvez notifications@github.com wrote:

Closed #2 https://github.com/parvez/snapshot_for_kibana/issues/2.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot_for_kibana/issues/2#event-714148887, or mute the thread https://github.com/notifications/unsubscribe/APY-AJ7C_lODU7riQjcAT1d26BOWz66Jks5qS4OggaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

hamelsveld commented 8 years ago

Hi,

I get the following error and it does not see any dashboards

2016-07-06T12:29:34.496Z - debug: (helper_logger.js 110) [/api/dashboards] []body: {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"No feature for name [search]"}],"type":"illegal_argument_exception","reason":"No feature for name [search]"},"status":400} 2016-07-06T12:29:34.496Z - debug: (helper_logger.js 106) [/api/dashboards] []statuscode] 400 2016-07-06T12:29:34.472Z - debug: (server.js 113) [/api/dashboards] dashboards_list_url: http://base-elasticsearch:9200/api/search 2016-07-06T12:29:11.278Z - debug: (server.js 355) [START] Running on port: 8080 2016-07-06T12:29:11.178Z - debug: (server.js 57) [CRON_LIST] Reload: {} 2016-07-06T12:29:11.177Z - debug: (server.js 48) [CONFIGURATION] Reload: {"app_port":8080,"app_dir":"/deploy","os_type":"linux","phantomjs":{"wait_seconds":"30"},"type":{"kibana":false,"grafana":true},"dashboard_url":"http://base-elasticsearch:9200/dashboard/","dashboards_list_url":"http://base-elasticsearch:9200/api/search","basic_auth_users":[{"user":"u1","password":"p1"},{"user":"u2","password":"p2"}]} 2016-07-06T12:29:11.177Z - debug: (server.js 41) [reload_cron_list] RELOADING_CRON_LIST 2016-07-06T12:29:11.174Z - debug: (server.js 30) [reload_cron_list] Updating config

my server config looks like:

{ "app_port": 8080, "app_dir": "/deploy", "os_type": "linux", "phantomjs": { "wait_seconds": "30" }, "type": { "kibana": false, "grafana": true }, "dashboard_url": "http://base-elasticsearch:9200/dashboard/", "dashboards_list_url": "http://base-elasticsearch:9200/api/search", "basic_auth_users": [ {"user": "u1", "password": "p1"}, {"user": "u2", "password": "p2"} ] }

and the grafana version is grafana_3.0.4-1464167696_amd64.deb

Do you have any tips? and should I not be able to login to Grafana to access dashboards? because I cant find that back in your config….

On 06 Jul 2016, at 12:29, Parvez notifications@github.com wrote:

Closed #2 https://github.com/parvez/snapshot_for_kibana/issues/2.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot_for_kibana/issues/2#event-714148887, or mute the thread https://github.com/notifications/unsubscribe/APY-AJ7C_lODU7riQjcAT1d26BOWz66Jks5qS4OggaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

I think you are using elasticsearch url instead of grafana url. http://{grafana host:port}/api/search should return a json response with the list of dashboards like this one: http://play.grafana.org/api/search. Similarly the dashboard url: http://{grafana host:port}/dashboard/

hamelsveld commented 8 years ago

stupid! yes your right :)

On 06 Jul 2016, at 14:47, Parvez notifications@github.com wrote:

I think you are using elasticsearch url instead of grafana url. http://{grafana host:port}/api/search should return a json response with the list of dashboards like this one: http://play.grafana.org/api/search http://play.grafana.org/api/search. Similarly the dashboard url: http://{grafana host:port}/dashboard/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot_for_kibana/issues/2#issuecomment-230760961, or mute the thread https://github.com/notifications/unsubscribe/APY-AGoWdMhIab5FGAF1Qa0Thqf9W8clks5qS6PYgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

hamelsveld commented 8 years ago

Hi,

Still a question for you when I go to url

/dashboard

I get a 404 and there are about 6 dashboards there ….

then I go to the /api/search that wil give me an array back with my dashboards.

But when I look in your tool I cant select any dashboards the select box stay’s empty?!?! Can you please advice? p.s.here is the server log

2016-07-07T13:00:57.736Z - debug: (server.js 315) [/api/logs/:id/:filter] Params: {"id":"server","filter":"all"} 2016-07-07T13:00:47.890Z - debug: (server.js 57) [CRON_LIST] Reload: {} 2016-07-07T13:00:47.890Z - debug: (server.js 48) [CONFIGURATION] Reload: {"app_port":8080,"app_dir":"/deploy","os_type":"linux","phantomjs":{"wait_seconds":"30"},"type":{"kibana":false,"grafana":true},"dashboard_url":"http://compose_monitoring-grafana-frontend_1:3000/dashboard","dashboards_list_url":"http://compose_monitoring-grafana-frontend_1:3000/api/search","basic_auth_users":[{"user":"admin","password":"admin"},{"user":"u2","password":"p2"}]} 2016-07-07T13:00:47.890Z - debug: (server.js 284) [/api/cron] Successfully listed crons: {"aaData":[]} 2016-07-07T13:00:47.889Z - debug: (server.js 41) [reload_cron_list] RELOADING_CRON_LIST 2016-07-07T13:00:47.889Z - debug: (server.js 275) [/api/cron] GET 2016-07-07T13:00:40.738Z - error: (server.js 349) [/api/logs/crontab] UNABLE_TO_GET_CRONTAB 2016-07-07T13:00:40.723Z - error: (server.js 332) [/api/logs/:id/:filter] UNABLE_TO_TAIL_LOG 2016-07-07T13:00:40.721Z - debug: (server.js 320) [/api/logs/:id/:filter] Data: 2016-07-07T12:59:40.833Z - debug: (server.js 30) [reload_cron_list] Updating config 2016-07-07T13:00:40.695Z - debug: (server.js 315) [/api/logs/:id/:filter] Params: {"id":"generate","filter":"all"} 2016-07-07T13:00:40.690Z - debug: (server.js 315) [/api/logs/:id/:filter] Params: {"id":"server","filter":"all"} 2016-07-07T13:00:40.690Z - debug: (server.js 315) [/api/logs/:id/:filter] Params: {"id":"server","filter":"all"} 2016-07-07T13:00:38.949Z - debug: (server.js 284) [/api/cron] Successfully listed crons: {"aaData":[]} 2016-07-07T13:00:38.949Z - debug: (server.js 284) [/api/cron] Successfully listed crons: {"aaData":[]} 2016-07-07T13:00:38.948Z - debug: (server.js 57) [CRON_LIST] Reload: {} 2016-07-07T13:00:38.948Z - debug: (server.js 57) [CRON_LIST] Reload: {} 2016-07-07T13:00:38.947Z - debug: (server.js 48) [CONFIGURATION] Reload: {"app_port":8080,"app_dir":"/deploy","os_type":"linux","phantomjs":{"wait_seconds":"30"},"type":{"kibana":false,"grafana":true},"dashboard_url":"http://compose_monitoring-grafana-frontend_1:3000/dashboard","dashboards_list_url":"http://compose_monitoring-grafana-frontend_1:3000/api/search","basic_auth_users":[{"user":"admin","password":"admin"},{"user":"u2","password":"p2"}]} 2016-07-07T13:00:38.947Z - debug: (server.js 48) [CONFIGURATION] Reload: {"app_port":8080,"app_dir":"/deploy","os_type":"linux","phantomjs":{"wait_seconds":"30"},"type":{"kibana":false,"grafana":true},"dashboard_url":"http://compose_monitoring-grafana-frontend_1:3000/dashboard","dashboards_list_url":"http://compose_monitoring-grafana-frontend_1:3000/api/search","basic_auth_users":[{"user":"admin","password":"admin"},{"user":"u2","password":"p2"}]} 2016-07-07T13:00:38.946Z - debug: (server.js 41) [reload_cron_list] RELOADING_CRON_LIST 2016-07-07T13:00:38.946Z - debug: (server.js 41) [reload_cron_list] RELOADING_CRON_LIST 2016-07-07T13:00:38.945Z - debug: (server.js 275) [/api/cron] GET 2016-07-07T13:00:38.945Z - debug: (server.js 275) [/api/cron] GET 2016-07-07T13:00:38.920Z - debug: (server.js 72) [/api/data] directory: /deploy/data 2016-07-07T13:00:38.920Z - debug: (server.js 72) [/api/data] directory: /deploy/data 2016-07-07T13:00:38.919Z - debug: (server.js 68) [/api/data] query: "" 2016-07-07T13:00:38.919Z - debug: (server.js 68) [/api/data] query: "" 2016-07-07T13:00:38.882Z - debug: (server.js 139) [/api/dashboards] NO_GRAFANA_DASHBOARDS 2016-07-07T13:00:38.882Z - debug: (server.js 139) [/api/dashboards] NO_GRAFANA_DASHBOARDS 2016-07-07T13:00:38.881Z - debug: (helper_logger.js 110) [/api/dashboards] []body: {"message":"Unauthorized"} 2016-07-07T13:00:38.881Z - debug: (helper_logger.js 110) [/api/dashboards] []body: {"message":"Unauthorized"} 2016-07-07T13:00:38.880Z - debug: (helper_logger.js 106) [/api/dashboards] []statuscode] 401 2016-07-07T13:00:38.880Z - debug: (helper_logger.js 106) [/api/dashboards] []statuscode] 401 2016-07-07T13:00:38.842Z - debug: (server.js 113) [/api/dashboards] dashboards_list_url: http://compose_monitoring-grafana-frontend_1:3000/api/search 2016-07-07T13:00:38.842Z - debug: (server.js 113) [/api/dashboards] dashboards_list_url: http://compose_monitoring-grafana-frontend_1:3000/api/search 2016-07-07T12:59:40.897Z - debug: (server.js 355) [START] Running on port: 8080 2016-07-07T12:59:40.897Z - debug: (server.js 355) [START] Running on port: 8080 2016-07-07T12:59:40.835Z - debug: (server.js 57) [CRON_LIST] Reload: {} 2016-07-07T12:59:40.835Z - debug: (server.js 57) [CRON_LIST] Reload: {} 2016-07-07T12:59:40.835Z - debug: (server.js 48) [CONFIGURATION] Reload: {"app_port":8080,"app_dir":"/deploy","os_type":"linux","phantomjs":{"wait_seconds":"30"},"type":{"kibana":false,"grafana":true},"dashboard_url":"http://compose_monitoring-grafana-frontend_1:3000/dashboard","dashboards_list_url":"http://compose_monitoring-grafana-frontend_1:3000/api/search","basic_auth_users":[{"user":"admin","password":"admin"},{"user":"u2","password":"p2"}]} 2016-07-07T12:59:40.835Z - debug: (server.js 48) [CONFIGURATION] Reload: {"app_port":8080,"app_dir":"/deploy","os_type":"linux","phantomjs":{"wait_seconds":"30"},"type":{"kibana":false,"grafana":true},"dashboard_url":"http://compose_monitoring-grafana-frontend_1:3000/dashboard","dashboards_list_url":"http://compose_monitoring-grafana-frontend_1:3000/api/search","basic_auth_users":[{"user":"admin","password":"admin"},{"user":"u2","password":"p2"}]} 2016-07-07T12:59:40.834Z - debug: (server.js 41) [reload_cron_list] RELOADING_CRON_LIST 2016-07-07T12:59:40.834Z - debug: (server.js 41) [reload_cron_list] RELOADING_CRON_LIST 2016-07-07T12:59:40.833Z - debug: (server.js 30) [reload_cron_list] Updating config last but not least at the tapb in the screen I see a ^g ^m ^l next to the name is that correct?

On 06 Jul 2016, at 14:48, Sven van Hamelsveld sven@200bar.net wrote:

stupid! yes your right :)

On 06 Jul 2016, at 14:47, Parvez <notifications@github.com mailto:notifications@github.com> wrote:

I think you are using elasticsearch url instead of grafana url. http://{grafana host:port}/api/search should return a json response with the list of dashboards like this one: http://play.grafana.org/api/search http://play.grafana.org/api/search. Similarly the dashboard url: http://{grafana host:port}/dashboard/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot_for_kibana/issues/2#issuecomment-230760961, or mute the thread https://github.com/notifications/unsubscribe/APY-AGoWdMhIab5FGAF1Qa0Thqf9W8clks5qS6PYgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net http://200bar.net/ “What I dream of is an art of balance”

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

You are missing an extra backslash in your dashboard url. Should be like this: "dashboard_url":"http://compose_monitoring-grafana-frontend_1:3000/dashboard/"

hamelsveld commented 8 years ago

Hi tried that also and get also a 404….

http://compose_monitoring-grafana-frontend_1:3000/dashboard/

but is a weird 404…

On 07 Jul 2016, at 21:02, Parvez notifications@github.com wrote:

You are missing an extra backslash in your dashboard url. Should be like this: "dashboard_url":"http://compose_monitoring-grafana-frontend_1:3000/dashboard/"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231175419, or mute the thread https://github.com/notifications/unsubscribe/APY-AB0OGUl6_KzTNzwmiv1zknHQ3uOfks5qTU0rgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

The dashboard url http://compose_monitoring-grafana-frontend_1:3000/dashboard/ is just prefix url that will be used to grab the actual dashboard remaining part from the dashboard list api.

"http://play.grafana.org/dashboard/" + "db/annotations"
 ^^^ from dashboard url config          ^^^ from dashboard list api response

As for the dashboards not populating in the select box, can you verify me the response of http://compose_monitoring-grafana-frontend_1:3000/api/search?

hamelsveld commented 8 years ago

but the /api/search gives me this:

[{"id":3,"title":"BAM Insights - Home","uri":"db/bam-insights-home","type":"dash-db","tags":["Base"],"isStarred":true},{"id":9,"title":"BeaconInfo","uri":"db/beaconinfo","type":"dash-db","tags":["Base"],"isStarred":false},{"id":8,"title":"CKR API details","uri":"db/ckr-api-details","type":"dash-db","tags":["CKR"],"isStarred":false},{"id":4,"title":"CKR Basics","uri":"db/ckr-basics","type":"dash-db","tags":["CKR"],"isStarred":false},{"id":5,"title":"CKR Basics Test copy PZ","uri":"db/ckr-basics-test-copy-pz","type":"dash-db","tags":["CKR"],"isStarred":false},{"id":13,"title":"CKR Demo KPI","uri":"db/ckr-demo-kpi","type":"dash-db","tags":["CKR"],"isStarred":false},{"id":7,"title":"CKR Process Mining Input","uri":"db/ckr-process-mining-input","type":"dash-db","tags":["CKR"],"isStarred":false},{"id":10,"title":"ElastAlert","uri":"db/elastalert","type":"dash-db","tags":["Alerting","Base"],"isStarred":false},{"id":6,"title":"OpenAPI","uri":"db/openapi","type":"dash-db","tags":["Mashery"],"isStarred":false},{"id":1,"title":"STML RAW Data","uri":"db/stml-raw-data","type":"dash-db","tags":["Base"],"isStarred":false},{"id":11,"title":"Social #klm","uri":"db/social-klm","type":"dash-db","tags":[],"isStarred":false}] so that is working right…

if I add the uri “/db/xxxx” behind the /dashboard/ then it’s working….

so how come I’m not able to select any dashboards in your tool?

Gr Sven

On 08 Jul 2016, at 08:16, Parvez notifications@github.com wrote:

The dashboard url http://compose_monitoring-grafana-frontend_1:3000/dashboard/ is just prefix url that will be used to grab the actual dashboard remaining part from the dashboard list api.

"http://play.grafana.org/dashboard/ http://play.grafana.org/dashboard/" + "db/annotations" ^^^ from dashboard url config ^^^ from dashboard list api response

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231283643, or mute the thread https://github.com/notifications/unsubscribe/APY-AE2dt2FF3XGxPTX5vBNiXyxe4gOcks5qTes7gaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

screen shot 2016-07-07 at 11 44 08 pm Thats weird. Can you go to this url http://{SNAPSHOT_APP_HOST_AND_PORT}/api/dashboards and check on the logs on the app's page and share me the responses? I tried again with grafana demo and it works.

hamelsveld commented 8 years ago

sure,

the response is []

server log

seems no new records in the log file

2016-07-08T06:46:35.991Z - debug: (server.js 315) [/api/logs/:id/:filter] Params: {"id":"server","filter":"all"} 2016-07-08T06:46:33.392Z - error: (server.js 349) [/api/logs/crontab] UNABLE_TO_GET_CRONTAB 2016-07-08T06:46:33.367Z - error: (server.js 332) [/api/logs/:id/:filter] UNABLE_TO_TAIL_LOG 2016-07-08T06:46:33.362Z - debug: (server.js 320) [/api/logs/:id/:filter] Data: 2016-07-07T14:25:28.537Z - error: (server.js 332) [/api/logs/:id/:filter] UNABLE_TO_TAIL_LOG 2016-07-08T06:46:33.346Z - debug: (server.js 315) [/api/logs/:id/:filter] Params: {"id":"generate","filter":"all"} 2016-07-08T06:46:33.337Z - debug: (server.js 315) [/api/logs/:id/:filter] Params: {"id":"server","filter":"error"} 2016-07-08T06:46:33.337Z - debug: (server.js 315) [/api/logs/:id/:filter] Params: {"id":"server","filter":"error"} 2016-07-08T06:45:48.046Z - debug: (server.js 139) [/api/dashboards] NO_GRAFANA_DASHBOARDS 2016-07-08T06:45:48.045Z - debug: (helper_logger.js 110) [/api/dashboards] []body: {"message":"Unauthorized"} 2016-07-08T06:45:48.045Z - debug: (helper_logger.js 106) [/api/dashboards] []statuscode] 401 2016-07-08T06:45:48.035Z - debug: (server.js 113) [/api/dashboards] dashboards_list_url: http://compose_monitoring-grafana-frontend_1:3000/api/search 2016-07-08T06:34:37.840Z - debug: (server.js 284) [/api/cron] Successfully listed crons: {"aaData":[]} 2016-07-08T06:34:37.839Z - debug: (server.js 57) [CRON_LIST] Reload: {} 2016-07-08T06:34:37.839Z - debug: (server.js 48) [CONFIGURATION] Reload: {"app_port":8080,"app_dir":"/deploy","os_type":"linux","phantomjs":{"wait_seconds":"30"},"type":{"kibana":false,"grafana":true},"dashboard_url":"https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/bam-insights-home","dashboards_list_url":"http://compose_monitoring-grafana-frontend_1:3000/api/search","basic_auth_users":[{"user":"admin","password":"admin"},{"user":"u2","password":"p2"}]}

parvez commented 8 years ago

Oh! I see 401 error code. That means its unauthorized to view the content. Is grafana password protected?

hamelsveld commented 8 years ago

yes it is.

On 08 Jul 2016, at 08:53, Parvez notifications@github.com wrote:

Oh! I see 401 error code. That means its unauthorized to view the content. Is grafana password protected?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231288627, or mute the thread https://github.com/notifications/unsubscribe/APY-AJ8eMK1Aj8iyyLl266D4t4zhUd85ks5qTfPqgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

Usually kibana does not have any authentication. What kind of authentication do you have for grafana?

hamelsveld commented 8 years ago

we are using the build in userid/passwd meganism

this way we can give each user only it’s own dashboards and by using separate idexes in elasticsearch for each application they can only see there own data. ….

On 08 Jul 2016, at 08:55, Parvez notifications@github.com wrote:

Usually kibana does not have any authentication. What kind of authentication do you have for grafana?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231288927, or mute the thread https://github.com/notifications/unsubscribe/APY-AByajfInShOR-8BIKL8R9vaj7sxdks5qTfRtgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

I'm sorry, authentication is not supported. It might be lot more work to support that. In our case, ElasticSearch and Kibana was not accessible to the users. It runs just as a backend service, so no authentication was required.

hamelsveld commented 8 years ago

okay bummer…. it seems that your tool was the perfect solution so i’ll go search for some thing else…. thanks anyways for your help so far :)

On 08 Jul 2016, at 09:06, Parvez notifications@github.com wrote:

I'm sorry, authentication is not supported. It might be lot more work to support that. In our case, ElasticSearch and Kibana was not accessible to the users. It runs just as a backend service, so no authentication was required.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231290562, or mute the thread https://github.com/notifications/unsubscribe/APY-AOOG_hDsRZ-K9X8zinE32U4c0eZaks5qTfcNgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

I just looked up the docs for grafana, and it might be possible to use API token to authenticate. http://docs.grafana.org/http_api/auth/. Do you want me to test that?

hamelsveld commented 8 years ago

well any way to get it to work would be great :)

On 08 Jul 2016, at 09:09, Parvez notifications@github.com wrote:

I just looked up the docs for grafana, and it might be possible to use API token to authenticate. http://docs.grafana.org/http_api/auth/ http://docs.grafana.org/http_api/auth/. Do you want me to test that?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231290955, or mute the thread https://github.com/notifications/unsubscribe/APY-ABJEPwFpfJkWLh_VhH5D-avo5QFCks5qTfeygaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

Cool! I added support for custom request headers. Follow http://docs.grafana.org/http_api/auth/ to create auth key. Then, in the configuration file (config/server.json), replace: "request_headers": false, with "request_headers": { "Accept": "application/json", "Authorization": "Bearer <your api key>" }

Let me know if it works! đź‘Ť

hamelsveld commented 8 years ago

cool give me a few min…

On 08 Jul 2016, at 09:29, Parvez notifications@github.com wrote:

Cool! I added support for custom request headers. Follow http://docs.grafana.org/http_api/auth/ http://docs.grafana.org/http_api/auth/ to create auth key. Then, in the configuration file (config/server.json), replace:

"request_headers": false,

with

"request_headers": { "Accept": "application/json", "Authorization": "Bearer " }

Let me know if it works! đź‘Ť

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231293981, or mute the thread https://github.com/notifications/unsubscribe/APY-ALNev5T3JfZ9UcSzabziGzPFN76dks5qTfx0gaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

hamelsveld commented 8 years ago

hi,

here my config and my error…

{ "app_port": 80, "app_dir": "/deploy", "os_type": "linux", "phantomjs": { "wait_seconds": "30" }, "type": { "kibana": false, "grafana": true }, "request_headers": { "Accept": "application/json", "Authorization": "Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0=" } "dashboard_url": "https://compose_monitoring-grafana-frontend_1:3000/dashboard/", "dashboards_list_url": "http://compose_monitoring-grafana-frontend_1:3000/api/search", "basic_auth_users": [ {"user": "u1", "password": "p1"}, {"user": "u2", "password": "p2"} ] }

stml-reporter_1 | Starting crond: [ OK ] stml-reporter_1 | stml-reporter_1 | module.js:485 stml-reporter_1 | throw err; stml-reporter_1 | ^ stml-reporter_1 | SyntaxError: /deploy/config/server.json: Unexpected string stml-reporter_1 | at Object.parse (native) stml-reporter_1 | at Object.Module._extensions..json (module.js:482:27) stml-reporter_1 | at Module.load (module.js:356:32) stml-reporter_1 | at Function.Module._load (module.js:312:12) stml-reporter_1 | at Module.require (module.js:364:17) stml-reporter_1 | at require (module.js:380:17) stml-reporter_1 | at /deploy/server.js:13:16 stml-reporter_1 | at ChildProcess. (/deploy/node_modules/crontab/lib/index.js:336:13) stml-reporter_1 | at ChildProcess.emit (events.js:98:17) stml-reporter_1 | at maybeClose (child_process.js:766:16)

On 08 Jul 2016, at 09:29, Parvez notifications@github.com wrote:

"request_headers": { "Accept": "application/json", "Authorization": "Bearer " }

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

sorry, there is a missing coma at the end of the request header item:

 "request_headers": {
  "Accept": "application/json",
  "Authorization": "Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="
  },
hamelsveld commented 8 years ago

okay it’s getting better :)

I get the option to select a dashboard but see this error

2016-07-08T08:12:02.075Z error Unable to load the URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:12:02.046Z INFO waitTime: 30000ms 2016-07-08T08:12:02.046Z INFO output: png 2016-07-08T08:12:02.046Z INFO dashboard: db/social-klm 2016-07-08T08:12:02.046Z INFO URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:12:02.046Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T08:12:02.045Z INFO zoomFactor: 1 2016-07-08T08:12:02.044Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"]

parvez commented 8 years ago

interesting. Let me check on this.

parvez commented 8 years ago

I have checked in some debugging code for this issue. Can you please help update and send me logs after trying again. I need to see why the page load failed, as earlier I did not log the error.

You just need to update this file: /app/helper_generate.js https://github.com/parvez/snapshot/blob/4190ca209feae3a25d6a68083b584e56d1ba401a/app/helper_generate.js

hamelsveld commented 8 years ago

give me a min again :)

On 08 Jul 2016, at 10:36, Parvez notifications@github.com wrote:

I have checked in some debugging code for this issue. Can you please help update and send me logs after trying again. I need to see why the page load failed, as earlier I did not log the error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231305534, or mute the thread https://github.com/notifications/unsubscribe/APY-AMy8PUo8YLCAsC1UVx-dyd25z1dRks5qTgvwgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

hamelsveld commented 8 years ago

here the log after addin a snapshot

2016-07-08T08:51:04.634Z - debug: (server.js 318) [/api/logs/:id/:filter] Params: {"id":"server","filter":"all"} 2016-07-08T08:51:02.907Z - debug: (server.js 72) [/api/data] directory: /deploy/data 2016-07-08T08:51:02.906Z - debug: (server.js 68) [/api/data] query: "" 2016-07-08T08:50:58.283Z - debug: (server.js 57) [CRON_LIST] Reload: {"144ae760-6e13-4ad9-8e48-430b58a44ab5":{"dateadded":1467967858100,"name":"test 1","cron":"* * * * ","cron_string":"Every minute","dashboard":"db/social-klm","type":"png"}} 2016-07-08T08:50:58.283Z - debug: (server.js 287) [/api/cron] Successfully listed crons: {"aaData":[{"dateadded":1467967858100,"name":"test 1","cron":" * * * *","cron_string":"Every minute","dashboard":"db/social-klm","type":"png","id":"144ae760-6e13-4ad9-8e48-430b58a44ab5"}]} 2016-07-08T08:50:58.279Z - debug: (server.js 48) [CONFIGURATION] Reload: {"app_port":80,"app_dir":"/deploy","os_type":"linux","phantomjs":{"wait_seconds":"30"},"type":{"kibana":false,"grafana":true},"request_headers":{"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="},"dashboard_url":"https://compose_monitoring-grafana-frontend_1:3000/dashboard/","dashboards_list_url":"http://compose_monitoring-grafana-frontend_1:3000/api/search","basic_auth_users":[{"user":"u1","password":"p1"},{"user":"u2","password":"p2"}]}

parvez commented 8 years ago

sorry can you provide me from the generate log.

hamelsveld commented 8 years ago

here it is

2016-07-08T08:55:01.391Z INFO fail 2016-07-08T08:55:01.391Z error Unable to load the URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:55:01.365Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T08:55:01.364Z INFO zoomFactor: 1 2016-07-08T08:55:01.364Z INFO waitTime: 30000ms 2016-07-08T08:55:01.364Z INFO output: png 2016-07-08T08:55:01.364Z INFO dashboard: db/social-klm 2016-07-08T08:55:01.364Z INFO URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:55:01.364Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"] 2016-07-08T08:54:01.344Z INFO fail 2016-07-08T08:54:01.344Z error Unable to load the URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:54:01.308Z INFO waitTime: 30000ms 2016-07-08T08:54:01.308Z INFO output: png 2016-07-08T08:54:01.308Z INFO dashboard: db/social-klm 2016-07-08T08:54:01.308Z INFO URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:54:01.308Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T08:54:01.307Z INFO zoomFactor: 1 2016-07-08T08:54:01.307Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"] 2016-07-08T08:53:01.244Z INFO fail 2016-07-08T08:53:01.244Z error Unable to load the URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:53:01.224Z INFO zoomFactor: 1 2016-07-08T08:53:01.224Z INFO waitTime: 30000ms 2016-07-08T08:53:01.224Z INFO output: png 2016-07-08T08:53:01.224Z INFO dashboard: db/social-klm 2016-07-08T08:53:01.224Z INFO URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:53:01.224Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T08:53:01.224Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"] 2016-07-08T08:52:01.205Z INFO fail 2016-07-08T08:52:01.205Z error Unable to load the URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:52:01.179Z INFO zoomFactor: 1 2016-07-08T08:52:01.179Z INFO waitTime: 30000ms 2016-07-08T08:52:01.179Z INFO output: png 2016-07-08T08:52:01.179Z INFO dashboard: db/social-klm 2016-07-08T08:52:01.179Z INFO URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:52:01.179Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T08:52:01.179Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"] 2016-07-08T08:51:02.253Z error Unable to load the URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:51:02.252Z INFO fail 2016-07-08T08:51:02.222Z INFO zoomFactor: 1 2016-07-08T08:51:02.222Z INFO waitTime: 30000ms 2016-07-08T08:51:02.222Z INFO output: png 2016-07-08T08:51:02.222Z INFO dashboard: db/social-klm 2016-07-08T08:51:02.222Z INFO URL: https://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T08:51:02.222Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T08:51:02.221Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"]

On 08 Jul 2016, at 10:55, Parvez notifications@github.com wrote:

sorry can you provide me from the generate log.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231309310, or mute the thread https://github.com/notifications/unsubscribe/APY-AEFRrIXWDSBGn30mG0C8RGfyihunks5qThCEgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

hamelsveld commented 8 years ago

I’ve a typo to https I see …

let me check that one

On 08 Jul 2016, at 10:43, Sven van Hamelsveld sven@200bar.net wrote:

give me a min again :)

On 08 Jul 2016, at 10:36, Parvez <notifications@github.com mailto:notifications@github.com> wrote:

I have checked in some debugging code for this issue. Can you please help update and send me logs after trying again. I need to see why the page load failed, as earlier I did not log the error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231305534, or mute the thread https://github.com/notifications/unsubscribe/APY-AMy8PUo8YLCAsC1UVx-dyd25z1dRks5qTgvwgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net http://200bar.net/ “What I dream of is an art of balance”

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

hamelsveld commented 8 years ago

Yup ome more step closer…

it generates a snapshot now but …

Cannot GET /data/20160708090031%20-%20Grafana%20-%20Social%20

full url http://192.168.99.100:32820/data/20160708090031%20-%20Grafana%20-%20Social%20#klm.png

here the generated log 2016-07-08T09:02:32.089Z INFO Successfully rendered URL: http://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T09:02:01.911Z INFO success 2016-07-08T09:02:01.491Z INFO zoomFactor: 1 2016-07-08T09:02:01.491Z INFO waitTime: 30000ms 2016-07-08T09:02:01.491Z INFO output: png 2016-07-08T09:02:01.491Z INFO dashboard: db/social-klm 2016-07-08T09:02:01.491Z INFO URL: http://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T09:02:01.491Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T09:02:01.491Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"] 2016-07-08T09:01:33.925Z INFO Successfully rendered URL: http://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T09:01:01.776Z INFO success 2016-07-08T09:01:01.357Z INFO zoomFactor: 1 2016-07-08T09:01:01.357Z INFO waitTime: 30000ms 2016-07-08T09:01:01.357Z INFO output: png 2016-07-08T09:01:01.357Z INFO dashboard: db/social-klm 2016-07-08T09:01:01.357Z INFO URL: http://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T09:01:01.357Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T09:01:01.357Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"] 2016-07-08T09:00:32.309Z INFO Successfully rendered URL: http://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T09:00:01.895Z INFO success 2016-07-08T09:00:01.395Z INFO zoomFactor: 1 2016-07-08T09:00:01.395Z INFO waitTime: 30000ms 2016-07-08T09:00:01.395Z INFO output: png 2016-07-08T09:00:01.395Z INFO dashboard: db/social-klm 2016-07-08T09:00:01.395Z INFO URL: http://compose_monitoring-grafana-frontend_1:3000/dashboard/db/social-klm 2016-07-08T09:00:01.395Z INFO Request Headers: {"Accept":"application/json","Authorization":"Bearer eyJrIjoiVkxBMzRMWVZhMWNXVTlKcTZMMjVBTGo1N0hsQ2dpblEiLCJuIjoic25hcHNob3QiLCJpZCI6MX0="} 2016-07-08T09:00:01.394Z INFO Arguments: ["/deploy/helper_generate.js","/deploy/data/","db/social-klm","png","30"]

On 08 Jul 2016, at 10:58, Sven van Hamelsveld sven@200bar.net wrote:

I’ve a typo to https I see …

let me check that one

On 08 Jul 2016, at 10:43, Sven van Hamelsveld <sven@200bar.net mailto:sven@200bar.net> wrote:

give me a min again :)

On 08 Jul 2016, at 10:36, Parvez <notifications@github.com mailto:notifications@github.com> wrote:

I have checked in some debugging code for this issue. Can you please help update and send me logs after trying again. I need to see why the page load failed, as earlier I did not log the error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231305534, or mute the thread https://github.com/notifications/unsubscribe/APY-AMy8PUo8YLCAsC1UVx-dyd25z1dRks5qTgvwgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net http://200bar.net/ “What I dream of is an art of balance”

Met vriendelijke groet,

Sven http://200bar.net http://200bar.net/ “What I dream of is an art of balance”

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

Awesome! Looks like filename cannot have hash. Checked in the fix. Please try again!

You just need to update this file: /app/helper_generate.js https://github.com/parvez/snapshot/blob/56fe5aab2c9146dbaa86399aacaa78eda73fc7fb/app/helper_generate.js

hamelsveld commented 8 years ago

Hi,

Okay it’s working now :)

but haha there is always a but…. the name is not taken over from the rule….

On 08 Jul 2016, at 11:12, Parvez notifications@github.com wrote:

Awesome! Looks like filename cannot have hash. Checked in the fix. Please try again!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231312754, or mute the thread https://github.com/notifications/unsubscribe/APY-AAGFrU9pqL3L2DMjOck-U-gdVijBks5qThR0gaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

Yup! Thats a bug. Too sleepy now :) Can you file it as a new issue? I will check on it tomorrow.

hamelsveld commented 8 years ago

sure! sleep well and thanks so far :)

Can I also add an other request? and that’s the possibility to e-mail the report automatically after it’s generated? or will you not support that?

Gr Sven

On 08 Jul 2016, at 11:25, Parvez notifications@github.com wrote:

Yup! Thats a bug. Too sleepy now :) Can you file it as a new issue? I will check on it tomorrow.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231315329, or mute the thread https://github.com/notifications/unsubscribe/APY-ACkijDZE-2fYKyDt0O8jPPzpft0Xks5qThdsgaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

parvez commented 8 years ago

I would love to add that. Add the issue as enhancement request.

hamelsveld commented 8 years ago

Hi,

I’ve added a few more points hope you dont mind :)

Gr Sven

On 08 Jul 2016, at 11:31, Parvez notifications@github.com wrote:

I would love to add that. Add the issue as enhancement request.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/parvez/snapshot/issues/2#issuecomment-231316700, or mute the thread https://github.com/notifications/unsubscribe/APY-AMPtuvP4vR5kMJmiuqz9_jAebtgHks5qThj5gaJpZM4JF4e9.

Met vriendelijke groet,

Sven http://200bar.net “What I dream of is an art of balance”

hamelsveld commented 7 years ago

Hi,

Are you still planning on updating the snapshot tool?

GR Sven