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 55 forks source link

PDF reporter is listing only some of the host groups. #19

Closed mbuyukkarakas closed 3 years ago

mbuyukkarakas commented 3 years ago

I'm using zabbix 5.0 with centos 7 and php 7.0 / apache. PDF report is working almost okay but it is not listing all the groups. I dont know why but it's listing only some the host groups. Could you help me please to solve that ?

Thank you. Mehmet

martinm76 commented 3 years ago

That sounds weird. How many groups do you have? Can you show me a screenshot of your groups in Zabbix and what you see in the report generator? If need be, type them in here.

Any errors in your apache error_log?

mbuyukkarakas commented 3 years ago

Hello, first screen capture shows the zabbix groups list. And the second capture is all I can list from pdf reporter. As you can detect quickly, "physical servers" group is missing in the pdf report screen like many others.

h1 h2

martinm76 commented 3 years ago

And does 'zabbix-ldap' have access to all these groups? You are only shown groups that match your rights in Zabbix. Is zabbbix-ldap a Zabbix Super Admin? If not, what happens if you log on as a Super Admin in the report interface?

This seems to be the most likely cause, but there may be something else to it, of course.

mbuyukkarakas commented 3 years ago

Hello, the zabbix-ldap is super-admin. I tried with other account which have super-admin permissions. The result is the same.

mbuyukkarakas commented 3 years ago

Hello Martin, do you have any comment for this ? thank you.

martinm76 commented 3 years ago

I'll see if I can reproduce it, but my Production is still 4.4 and my test server has very few groups, so not sure I can. If the issue is a general issue, it should show up on 4.4, though.

mbuyukkarakas commented 3 years ago

Please make süre your groups contains characters like _ and/or numbers.

Good luck.

3 Oca 2021 Pzr 12:22 tarihinde martinm76 notifications@github.com şunu yazdı:

I'll see if I can reproduce it, but my Production is still 4.4 and my test server has very few groups, so not sure I can. If the issue is a general issue, it should show up on 4.4, though.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/martinm76/zabbix-pdf-report/issues/19#issuecomment-753589556, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUK4XUHQMVYQS5MQ7FPJNLSYAZMPANCNFSM4UF6C7FQ .

martinm76 commented 3 years ago

I have had a look while I was adjusting other things. I believe the issue lies here: chooser.php:

$host_groups = ZabbixAPI::fetch_array('hostgroup','get', array('output'=>array('groupid','name'),'real_hosts'=>'1','with_graphs'=>'1','sortfield'=>'name') )
        or die('Unable to get hosts: '.print_r(ZabbixAPI::getLastError(),true));

This automatically removed host groups with no actual hosts (just templates, empty, etc.) AND where no hosts in the group have graphs. Could one or both of these fit your case?

I can try to make it configurable in an upcoming version in config.inc.php.dist, but I would like you to try setting these to 0 and see if you get all the groups you expect.

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.