martinm76 / zabbix-pdf-report

Reporting tool in PHP for the Zabbix Monitoring Platform. Rather versatile reporting on hosts and host groups.
https://www.zabbix.com/forum/zabbix-cookbook/25368-zabbix-dynamic-pdf-report-generation?filter_time=time_lastmonth
GNU General Public License v3.0
52 stars 56 forks source link

Hide hosts with no graphs #21

Closed spence572 closed 1 month ago

spence572 commented 3 years ago

Hi,

Firstly this is a great plugin, good work.

I have run a report using the HostGroup option and it works perfectly and extracts the specific graphs for the hosts within that host group, however, not all my hosts have those graphs and as such in the report it shows the host name with a comment saying (something along the lines of) there was no valid graph to display. Is it possible to hide the host where there are no graphs to display?

Thanks

Paul

martinm76 commented 3 years ago

Thank you, @spence572 .

Regarding your question, it is easier said than done, especially since there are many other things than graphs that can be output. I believe a meta-file is generated that is later turned into the PDF, so possibly one could put in an extra read through it and look for hosts that had no real data added and remove those sections, or possibly an array could be built for each host and written later where you could inspect each object in the array for actual data before committing it to the file or not.

In other words, I'm sure it's possible, but I will not have the time to implement it for quite a while. If someone else would like to take a stab at it, please do.

mbuyukkarakas commented 3 years ago

I figured out the problem.

If there is no graph item created on host or any graph does not comes from the template, the pdf reporting doesnt show the host ,nor the group in the listing.

After creating at least one graph for the host, or graph prototype in the template, everything is ok.

Fyi.