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

Report range problem #1

Closed mark2045 closed 5 years ago

mark2045 commented 5 years ago

Hello, Martinm76!

After last update to 1.0.1 Custom Report range isn't work. When I choose period 01/09/2018-01/10/2018 in Debug mode we see that it take period range - last 1 hour. Could you fix?

image

martinm76 commented 5 years ago

Hey Mark. From what I have gathers with another user, this is related to the way Zabbix 4.x generates graphs and it would seem they have changed the parameters I need to send. I'll look into this when I have Zabbix 4.0.1 installed on my test system.

martinm76 commented 5 years ago

Hey Mark.

I have now managed to debug the issue in my test environment om Zabbix 4.0. The graphing has changed a lot (although the output is basically the same for our purposes).

I have attached a patch that should work on 4.0. I have yet to test that is doesn't break something in Zabbix 3.4 so not committed yet. Can you confirm it works for you?

Not only have they changed from stime and period to from and to, I also have to include ProfileIdx=web.graphs.filter for it to event respect the from and to values. Not sure why that is, but this seems to work here.

zabbix-40-graphs.patch.txt

amarodefarias commented 5 years ago

Hello.

Where should I put this file? Should it be renamed to createpdf.functions.php? I am waiting for the instructions to carry out the tests.

Thank you

From: martinm76 Sent: Saturday, October 20, 2018 5:44 PM To: martinm76/zabbix-pdf-report Cc: Subscribed Subject: Re: [martinm76/zabbix-pdf-report] Report range problem (#1)

Hey Mark.

I have now managed to debug the issue in my test environment om Zabbix 4.0. The graphing has changed a lot (although the output is basically the same for our purposes).

I have attached a patch that should work on 4.0. I have yet to test that is doesn't break something in Zabbix 3.4 so not committed yet. Can you confirm it works for you?

Not only have they changed from stime and period to from and to, I also have to include ProfileIdx=web.graphs.filter for it to event respect the from and to values. Not sure why that is, but this seems to work here.

zabbix-40-graphs.patch.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

martinm76 commented 5 years ago

Hi Mark.

Copy zabbix-40-graphs.patch.txt to the 'inc' dir of your installation. cd to the 'inc' dir of your installation. Run this command: patch <zabbix-40-graphs.patch.txt

That should update createpdf.functions.php at your end to be the same as mine, given you havent't manually changed the file. After that, the graphs ought to work.

amarodefarias commented 5 years ago

Hi. Thanks a lot for the help, you understand a lot! It must have taken a lot of work to do this, but know that it was worth it! It worked perfectly here.

Success!

From: martinm76 Sent: Saturday, October 20, 2018 7:57 PM To: martinm76/zabbix-pdf-report Cc: amarodefarias ; Comment Subject: Re: [martinm76/zabbix-pdf-report] Report range problem (#1)

Hi Mark.

Copy zabbix-40-graphs.patch.txt to the 'inc' dir of your installation. cd to the 'inc' dir of your installation. Run this command: patch <zabbix-40-graphs.patch.txt

That should update createpdf.functions.php at your end to be the same as mine, given you havent't manually changed the file. After that, the graphs ought to work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

martinm76 commented 5 years ago

The fix has been mainlined and also tested on 3.4 - it still works (with the old syntax also given). Closing the issue.