⬆️ ⬇️

Kibana Dashboards PDF Reports





Here you collected your trendy monitoring. ElasticSearch takes data from anything, and kibana draws it. You look at the charts one day, the second, the third, and after a while under the weight of new tasks you forget about it. You remember when you need to show the chiefs some kind of reporting, you enter the kibana, you take screenshots, and you think that it would be nice to have the means that it did for you.



Yes, it can do the X-Pack, but it costs money. Yes, sentinl can do this, but in order to configure it you will need to tinker, and he never learned to draw pdf. All you need is nothing: take a couple of screenshots, compile a PDF from them and send them to the post office, repeat in a week.

We did it for you. All that needs to be done is to clone the repository, describe the desired report in the config file, enter the data about the mail (from where and where to send) and here, you already have the reports. Flying on schedule, yeah.



Suppose you have a deployed kibana and three dashboards that you would like to show in the report. Then you describe these dashboards in the pages section of the file config (url dashboards, title and description for the report). It will look something like this:

')

"pages":[ { "url": "http://0.0.0.0:5601/app/kibana#/dashboard/ca460a50-8cb0-11e7-a2bb-9b97b18ab1d8?embed=true&_g=()", "title": " 1", "description": " " }, { "url": "http://0.0.0.0:5601/app/kibana#/dashboard/e05c6b70-8cb2-11e7-a2bb-9b97b18ab1d8?embed=true&_g=()", "title": " 2 ", "description": " " }, { "url": "http://0.0.0.0:5601/app/kibana#/dashboard/233acc20-8cb3-11e7-a2bb-9b97b18ab1d8?embed=true&_g=()", "title": " 3", "description": " " } ] 


After that, it remains only to enter data about the mail, and the desired time interval (how often reports will fly) in seconds:



 "smtp_server": "smtp.yandex.ru", "email_subject": " ", "email_text": "    ", "email_from": "email@fr.om", "email_password":"password", "time_interval": 120, "email_to": "email@to", 


After configuration, it remains only to start Reporter and it will start to work:



 docker-compose up -d 


Everything, now you have not only beautiful graphics, but also scheduled reports that can be used, for example, in conjunction with monitoring TLS settings in the grove of domains .



Here is the source code, and a simple, three-line instruction for setting and running.

Source: https://habr.com/ru/post/337576/



All Articles