Search code examples
phpmonitoringzabbix

Display Zabbix graphs on a custom web site


I want to display Zabbix graphs and screens on my wordpress website. How can I do this nicely and easily? I used Grafana which displays the graphs very clean and beautiful. But it takes a lot too load and also downloads about 10MB on every refresh!! So it is not my favorite. I want to show the resource usage of my customers's servers in a website. I can share the screen URL in an HTML frame, but it also shows the header and footer so the customer can click on the button 'Edit screen' or somewhere else and also logout the dashboard!! Is there any way to display only graphs without extra buttons, header and footer on my web site?


Solution

  • Use the chart2.php endpoint to plot the graph only:

    https://your.zabbix.server/zabbix/chart2.php?graphid=123456&from=now-7d&to=now

    As you can see the size of the chart is really small:

    enter image description here

    Of course you have to manage authentication (force the user to authenticate, embed it in a php wrapper etc.) or enable guest access.