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

Host/service filtering != for costumvar not working correctly #865

Closed
gbin2265 opened this issue Sep 6, 2023 · 4 comments · Fixed by #978
Closed

Host/service filtering != for costumvar not working correctly #865

gbin2265 opened this issue Sep 6, 2023 · 4 comments · Fixed by #978
Assignees
Labels
bug Something isn't working ref/IP
Milestone

Comments

@gbin2265
Copy link

gbin2265 commented Sep 6, 2023

Describe the bug

when I do a filtering on the host or service list it doesn't use the != operand correctly in the sql statement.
He converts it as = in the sql and not as !=

To Reproduce

do a basic filtering on the host/service list for a customvar with the operand != and check the sql statement (format=sql).

Expected behavior

I expect to see all services that do not have a value of 1 for the custumvar or that the custumvar does not exist for the service

sql

This you see with the format=sql


	where
		(sub_customvar_flat.flatvalue = '1')
			and (sub_customvar_flat.flatname = 'variablename')
			
	where
		sub_customvar_flat.flatname = 'variablename'))))


For me must this be

flatvalue != '1'

and the second part

flatname != 'variablename'

Your Environment

Latest snapshot for centos 7 on 23/09/02

regards,
Geert

@yhabteab
Copy link
Member

yhabteab commented Sep 7, 2023

Hi @gbin2265, these where clauses are for the subqueries, but the subqueries themselves are wrapped by either the sql IN() or NOT IN() operators, so this is actually not a bug. But while trying to reproduce your issue, we encountered another serious bug that also affects the outcome you expect (filtering for hosts/services that don't set customvar to 1 or not at all).

@gbin2265
Copy link
Author

gbin2265 commented Sep 7, 2023

I am not an SQL/PHP specialist, but there was something wrong that I did not get the correct output.

Thank you for your support to resolve this issue.

@nilmerg
Copy link
Member

nilmerg commented Feb 14, 2024

This is related to Icinga/ipl-orm#13 and can be fixed by commenting out this line. Though, cases (thankfully) mentioned in Icinga/ipl-orm#13 are not working anymore then.

@nilmerg
Copy link
Member

nilmerg commented Mar 13, 2024

ref/IP/52121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ref/IP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants