Hi All, this document deals with how to configure pdf exported in grafana Using this opensource application developed by IzakMarais , we achieved exporting pdf reports from the grafana server. Here are the following steps to follow.
wget https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.10.2.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
Download and install the pdf reporter application
go get github.com/IzakMarais/reporter/...
go install -v github.com/IzakMarais/reporter/cmd/grafana-reporter
Now start the application by using below command
/root/go/bin/grafana-reporter
Now go to server admin- API keys and create a new key with viewer privileges. save the token id as it’s required for next step
Now goto Grafana and choose a dashboard which you need to export into pdf. Goto setting of the dashboard and select add new option from the links tab, configure as below
Type: Link Url: http://{FQDN neteye server}:8686/api/v5/report/{dashboardUID}?apitoken={tokenid}
Title: PDF Tooltip: Generate a PDF of this Dashboard Icon: doc, to be an icon of a document. Time range: I put mark to allow periods of time. Variable values: Mark it to play with dates. Open in a new tab: We mark if we want the PDF to generate it in a new tab.
Then save and continue.
Open the dashboard now you can see the there is an icon for exporting pdf reports.
Here are the parameters supported by pdf exporter
Usage of ./grafana-reporter:
-cmd_apiKey string
Grafana API key. Required (and only used) in command-line mode
-cmd_apiVersion string
Api version: [v4, v5]. Required (and only used) in command line mode, example: -apiVersion v5 (default "v5")
-cmd_dashboard string
Dashboard identifier. Required (and only used) in command-line mode
-cmd_enable
Enable command line mode. Generate report from command line without starting webserver (-cmd_enable=1)
-cmd_o string
Output file. Required (and only used) in command line mode (default "out.pdf")
-cmd_template string
Specify a custom TeX template file. Only used in command line mode, but is optional even there.
-cmd_ts string
Time span. Required (and only used) in command line mode (default "from=now-3h&to=now")
-ip string
Grafana IP and port (default "localhost:3000")
-port string
Port to serve on (default ":8686")
-proto string
Grafana Protocol. Change to 'https://' if Grafana is using https. Reporter will still serve http. (default "http://")
-ssl-check
Check the SSL issuer and validity. Set this to false if your Grafana serves https using an unverified, self-signed certificate. (default true)
-templates string
Directory for custom TeX templates (default "templates/")
This is the sample logs while exporting the report.
I have error after this line any reason anyone can help?
go get github.com/IzakMarais/reporter/report/… go: missing Git command. See https://golang.org/s/gogetcmd package github.com/IzakMarais/reporter/report/…: exec: “git”: executable file not found in $PATH
Hi,
can you please clear two thing, what is below url value would be?
FQDN neteye server -> What is this fqdn
dashboardUID -> how will get this
you can get the dashboard ID from the browser URL which you navigate to any grafana dashboard.
the FQDN is the IP or hostname of the reporter tool got installed.
I have error after this line any reason anyone can help?
go get github.com/IzakMarais/reporter/report/…
go: missing Git command. See https://golang.org/s/gogetcmd
package github.com/IzakMarais/reporter/report/…: exec: “git”: executable file not found in $PATH
install git ..
Hi, thank you for the tips. I followed all instructions, however, when generating a report I get this error :
“No Image renderer available/installed”
Any idea what this is happening ?
Hi,
Followed all instructions and initially I got error about missing Grafana Image Renderer Plugin.
After installed the Grafana plugin, I get the following:
error rendering PNGs in parralel for dash {Title:Host Status Description:Status of a server monitored by zabbix agent VariableValues:LOGSPSQL, Windows Servers Rows:[] Panels:[{Id:2 Type:text Title:Host Information GridPos:{H:3 W:4 X:0 Y:0}} {Id:5 Type:stat Title:Uptime GridPos:{H:3 W:4 X:4 Y:0}} {Id:6 Type:singlestat Title:CPU Load GridPos:{H:3 W:4 X:8 Y:0}} {Id:1 Type:singlestat Title:Available Memory GridPos:{H:3 W:4 X:12 Y:0}} {Id:4 Type:singlestat Title:Number of processes GridPos:{H:3 W:4 X:16 Y:0}} {Id:3 Type:singlestat Title:Logged in Users GridPos:{H:3 W:4 X:20 Y:0}} {Id:12 Type:alexanderzobnin-zabbix-triggers-panel Title:Triggers GridPos:{H:9 W:24 X:0 Y:3}} {Id:7 Type:graph Title:CPU Usage GridPos:{H:7 W:8 X:0 Y:12}} {Id:8 Type:graph Title:Available Memory GridPos:{H:7 W:8 X:8 Y:12}} {Id:11 Type:graph Title:Free Swap \% GridPos:{H:7 W:8 X:16 Y:12}} {Id:10 Type:graph Title:Processor Load GridPos:{H:7 W:12 X:0 Y:19}} {Id:9 Type:graph Title:Network Traffic on eth0 GridPos:{H:7 W:12 X:12 Y:19}} {Id:14 Type:graph Title:IO/s GridPos:{H:7 W:12 X:0 Y:26}} {Id:13 Type:graph Title:Filesystems GridPos:{H:7 W:12 X:12 Y:26}}]}: error getting panel {Id:4 Type:singlestat Title:Number of processes GridPos:{H:3 W:4 X:16 Y:0}}: Error obtaining render: 500 Internal Server Error
missing step:
grafana-cli plugins install grafana-image-renderer