IzakMarais / reporter

Service that generates a PDF report from a Grafana dashboard
Apache License 2.0
946 stars 303 forks source link

reporter on grafana 7.1.5 #250

Open wasykp opened 3 years ago

wasykp commented 3 years ago

I'm trying to set the Reporter tool on the latest fresh Grafana 7.1.5 installation. After some tests, I stuck with the error shown on the screenshot.

2020-08-29_15h49_49

Could anyone give me some advice or just confirm that the Reporter works with Grafana 7.1.5 version. OS is CentOS8 w/o Selinux and with Firewalld disabled. The reporter is on the same VM as Grafana

jagaboom commented 3 years ago

I can confirm that everything (except for rendering a "text" panel - which I've logged under ticket #249 ) works on the following:

# cat /etc/lsb-release |grep DESC && zabbix_server -V | grep ^zabbix && mysql -V && grafana-server -v
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"
zabbix_server (Zabbix) 4.4.10
mysql  Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Version 7.1.5 (commit: 9893b8c53d, branch: HEAD)

The version of Grafana-Reporter I'm using is:

2020/08/29 16:44:19 grafana reporter, version: 2.3-0 hash: 124b9a35302b3e9d4746ec0cf643abfecda8c21d

I'm pretty new to Grafana - and Grafana-reporter, and I'm a Unix/AIX/Linux sysadmin so please don't ask me about how the Grafana* apps work :-)

razzrsi commented 3 years ago

I am also getting same issue with Grafana from 7.1 version. Not working as well despite of installing "grafana-image-renderer" Plugin. In my another setup with 5.0 version it is working fine without installing the same plugin.

jagaboom commented 3 years ago

I managed to do a (clunky) workaround, as my requirement was to display a logo and some text (using markdown) and include graphs on the rendered PDF.

So - I then looked at another plugin called “Dynamic Text for Grafana” (By Marcus Olsson ).

I changed the data source to “Grafana” and modified the “Query Options” as below:

image

I then changed the “Display” markdown to say:

image

…and the result, when rendering a dashboard which contains a panel from: • Zabbix data source • Grafana data source with Dynamic Text Panel …it looks like this – which is exactly what I’m trying to achieve for my customer reports 😊 (obviously not this particular content though 😉)

image

razzrsi commented 3 years ago

Not worked for me either "grafana-image-renderer" or "Dynamic Text for Grafana". Is it a bug for latest Grafana or anything else?? because Grafana older version it is working fine.

jagaboom commented 3 years ago

I've read a lot of related issues, and think it's become more apparent since the removal of Phantom.JS.

As I'm brand-new to Grafana, I've only ever used the very latest release.

This is a quick list of things I did yesterday to get a vanilla Ubuntu 20.04 system running, installed from "ubuntu-20.04.1-live-server-amd64.iso" - and I didn't install any additional packages during installation other than OpenSSH Server.

My notes only go up to the point where I added the Zabbix plugin - so don't include any notes for when I added the "Dynamic Text" plugin - but that's covered in my previous comments :-)

Hopefully there's something in this checklist that you may have missed or done differently that will allow you to at least use the Dynamic Text panel...

Hope it helps !

Pre-Reqs  
  LatEX - required for grafana-reporter
1 apt install texlive-base
2 apt install texlive-latex-recommended
3 apt install texlive
4 apt install texlive-latex-extra
GoLANG - required for grafaner-reporter  
5 apt install golang
   

Install Grafana-Server  assisted from guide here https://computingforgeeks.com/how-to-install-grafana-on-ubuntu-debian/ 6 | apt-get install -y gnupg2 curl  software-properties-common 7 | curl https://packages.grafana.com/gpg.key | sudo apt-key add - 8 | add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" 9 | apt-get -y update 10 | apt-get -y install grafana Start daemon |   11 | /bin/systemctl daemon-reload 12 | /bin/systemctl enable grafana-server 13 | /bin/systemctl start grafana-server Setup Firewall |   14 | apt -y install ufw 15 | ufw enable Restrict IP address range(s) and port(s) |   16 | ufw allow from 192.168.1.0/24 to any port 3000 17 | ufw allow from 192.168.1.0/24 to any port 22 Add the grafana-renderer |   18 | grafana-cli plugins install grafana-image-renderer   | ** may need the following:    libx11-6 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrender1 libxtst6 libglib2.0-0 libnss3 libcups2  libdbus-1-3 libxss1 libxrandr2 libgtk-3-0 libgtk-3-0 libasound2 Add grafana-reporter:   https://github.com/IzakMarais/reporter 19 | go get github.com/IzakMarais/reporter/... 20 | echo 'PATH=$PATH:/root/go/bin/' >> ~/.bashrc 21 | /etc/init.d/grafana-server stop 22 | /etc/init.d/grafana-server start 23 | grafana-reporter -grid-layout=1 24 | these notes assume all OK to here, so hit [CTRL][C] to kill grafana-reporter Now we want to run grafana-reporter at system startup, so we need to create a "service" definition 25 | echo "[Install] WantedBy=multi-user.target [Unit] After=network.service [Service] ExecStart=/root/go/bin/grafana-reporter -grid-layout=1 [Install] WantedBy=default.target " > /lib/systemd/system/grafana-reporter.service enable the reporter service |   26 | systemctl enable grafana-reporter we need to lower the security of Grafana by changing the value of a variable in /etc/grafana/grafana.ini 27 | disable_sanitize_html = true Now we want to add the grafana-reporter dashboard   |   |   |   |   |   |   |   |   |   |   |     |   |   |     |       |       28 | grafana-cli plugins install marcusolsson-dynamictext-panel add zabbix data source |   29 | /etc/init.d/grafana-server stop 30 | grafana-cli plugins install alexanderzobnin-zabbix-app 31 | /etc/init.d/grafana-server start 32 | grafana-reporter -grid-layout=1 & In grafana | Select plugins and scroll down and click Zabbix | Select plugins and scroll down and click Zabbix Select plugins and scroll down and click Zabbix   | vi /etc/grafana/grafana.ini change ;allow_loading_unsigned_plugins to allow_loading_unsigned_plugins = alexanderzobnin-zabbix-datasource   | /etc/init.d/grafana-server restart back in the grafana application | Refresh the webpage and add the Zabbix datasource | Refresh the webpage and add the Zabbix datasource Refresh the webpage and add the Zabbix datasource Then configure data source with a name / path to the URL and login credentials   |   |   |   |   |   |       |   |    

IzakMarais commented 3 years ago

@wasykp and @razzrsi : have you managed to get the dynamic text plugin working? If so, what where the steps needed?

You should be able to test this without the reporter from the Grafana UI directly by going Panel>SHare>direct link rendered image.

onefourfive commented 3 years ago

Do you know what type of panels the renderer is getting hung up on?

In my experience, in some recent versions of Grafana, some panels hang the renderer - alert lists, text panels, clocks to name a few.

I'm told these have been resolved in Grafana 7.3 but I haven't tested them yet.

razzrsi commented 3 years ago

Rendering issue resolved on CentOS 7 because few packages does not support in CentOS 6. Refer below link :

https://grafana.com/docs/grafana/latest/administration/image_rendering/

And majorly refer below section

Grafana image renderer plugin and remote rendering service

mbuyukkarakas commented 3 years ago

Totally agreed. It worked for me this solution on Centos7 / Grafana 7.x

https://grafana.com/docs/grafana/latest/administration/image_rendering/

yum install -y libXcomposite libXdamage libXtst cups libXScrnSaver pango atk adwaita-cursor-theme adwaita-icon-theme at at-spi2-atk at-spi2-core cairo-gobject colord-libs dconf desktop-file-utils ed emacs-filesystem gdk-pixbuf2 glib-networking gnutls gsettings-desktop-schemas gtk-update-icon-cache gtk3 hicolor-icon-theme jasper-libs json-glib libappindicator-gtk3 libdbusmenu libdbusmenu-gtk3 libepoxy liberation-fonts liberation-narrow-fonts liberation-sans-fonts liberation-serif-fonts libgusb libindicator-gtk3 libmodman libproxy libsoup libwayland-cursor libwayland-egl libxkbcommon m4 mailx nettle patch psmisc redhat-lsb-core redhat-lsb-submod-security rest spax time trousers xdg-utils xkeyboard-config