Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filtering for older-than events with relative time does not work #5263

Open
restena-sw opened this issue Sep 20, 2024 · 3 comments
Open

filtering for older-than events with relative time does not work #5263

restena-sw opened this issue Sep 20, 2024 · 3 comments
Labels
area/monitoring Affects the monitoring module

Comments

@restena-sw
Copy link

Describe the bug

Time-based filters take the operators <, <= and >, >= and the value can be an absolute or relative time.

Using an absolute time for the filter value always works correctly. E.g. querying for

Service Time Last Ok >= 2024-01-01 selects all services that were OK sometime this year; and the complement
Service Time Last Ok < 2024-01-01 selects all services that were not in OK state this year, but earlier

Using a relative time for the filter value works only for > and >=; it always yields 0 results when attempted with < and <=. E.g. querying for

Service Time Last Ok >= 9m selects all services that were OK sometime in the last nine months; but the complement
Service Time Last Ok < 9m selects nothing.

I also tried "-9m", "9 months" and "-9 months"; none of which produced the desired result.

The use case for such relative-time filter strings is the creation of a dashlet that shows problems that persist for a long time.

To Reproduce

For a given set of services with issues, find a point in time that has start/resolve occurences before and after that point in time. Then filter as discussed above using a relative time string to express the chosen point in time.

Expected behavior

The behaviour should be identical for absolute time and relative time values pointing to the same moment in time.

Screenshots

Can add some (redacted for privacy) if needed; I hope I'm clear enough with words.

Your Environment

  • Icinga Web 2 version and modules (System - About): 2.9 (but confirmed in a 2.12 that relative time still does not work, maybe in a different way)
  • Web browser used: Chromiusm 128
  • Icinga 2 version used (icinga2 --version): 2.13.2, OS package
  • Server operating system and version: CentOS 7 (now Suse Liberty Linux 7)
@nilmerg
Copy link
Member

nilmerg commented Sep 23, 2024

Hi,

9m is an invalid value. Try 9 minutes.

To see what's working, try https://strtotime.co.uk/

Though, we are aware that this is far from being useful and there is a proper UI validation/assistance required.

@nilmerg nilmerg closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
@restena-sw
Copy link
Author

I did try "x timespan" like as I wrote initially. So here are the screenshots with a "2 weeks" filter proving that it does not work:

  • filtering for <= and an absolute time working fine, showing various hits for "old" issues:
    icinga_abs_time_working

  • filtering with <= and both "2 weeks" and "-2 weeks" not showing any results

icinga_rel_time_pos_not_working
icinga_rel_time_neg_not_working

I have verified that "2 weeks" and "-2 weeks" are vaild expressions; the "-2 weeks" should be the one delivering the expected results.

Please re-open this issue report.

@nilmerg
Copy link
Member

nilmerg commented Sep 23, 2024

Ah, strtotime transformation isn't enabled for any of the service_last_time_* columns. You'll have to stick to absolute values for now, though.

@nilmerg nilmerg reopened this Sep 23, 2024
@nilmerg nilmerg added the area/monitoring Affects the monitoring module label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/monitoring Affects the monitoring module
Projects
None yet
Development

No branches or pull requests

2 participants