We have some custom reports created and they work fine up until 2024. Now, when I choose time window to be “Current Year” the time window changes to 2024-01-01 - 2023-12-31 and of course no data is shown due to the incorrect end date. Has anyone encountered something similar, we are using icinga2-2.13, icingaweb 2.9.5 and reporting module v0.10.0.
Can’t confirm that problem, but I’m using the most recent version.
So, as you are using quite outdated versions, I would suggest updates.
Icinga 2 core is available in v2.14.1, with many fixes and speedups regarding config generation.
Icinga Web 2 is available in v2.12.1 by now.
The reporting module in v1.0.1
If you don’t want or can’t upgrade you could take a look at the Time Frame tab of the module and check if you can adjust the “Current Year” timeframe by hand.
It looks like your icingaweb2 is using a custom report provided by a custom or patched reporting hook.
In this implementation someone might messed up the interpretation of the timeframe.
what modules do you have installed?
@log1c , thanks, upgrade is not an option at this point, maybe as last resort. I checked out the “Current Year” in the timelines and it looks like this
Funny thing is that I cannot really create time frame with such descriptive start and end times, I can only chose actual dates. I tried putting end date 31-12-2024 but the reports are still showing the same end date 31-12-2023, strange.
@moreamazingnick, indeed it seems like a custom thing, I inherited it like this, so I am not sure how it was setup. any hints where to look at for it ?
here are the modules
MODULE VERSION STATE DESCRIPTION
director 1.10.2 enabled Director - Config tool for Icinga 2
doc 2.9.5 enabled Documentation module
idoreports 0.10.0 enabled Reports for IDO
incubator 0.20.0 enabled Incubator provides bleeding-edge libraries
ipl 0.11.0 enabled This project bundles all Icinga PHP libraries into one piece and can be integrated as library into Icinga Web 2.
migrate 2.9.5 enabled Migrate module
monitoring 2.9.5 enabled Icinga monitoring module
pdfexport 0.10.2 enabled PDF Export via Google Chrome/Chromium
reporting 0.10.0 enabled Reporting
setup 2.9.5 enabled Setup module
translation 2.9.5 enabled Translation module
vendor 0.10.0 enabled This project bundles all 3rd party PHP libraries used by Icinga Web products into one piece, which can be integrated as library into Icinga Web 2.
Ok, I found it and figured it out (at least I think so). The current year end date was defined like this:
$window_end = date(“Y-m-d”, mktime(23, 59, 59, date(“m”), 0));
and I changed it to:
$window_end = date(“Y-m-d”, time());
Now the window end date shows fine, but I am not getting any data in the report. Could that be related to my change or there is some more fixing to be done in the report itself ?
which file did you edit?
good question, sorry forgot to provide it
This is not part of the official Icinga reporting module.
Without the code it is difficult to help debug that.
Can you upload the content of your reporting module on github?