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

New operand XOR or MAX 1 #206

Closed
slalomsk8er opened this issue Feb 26, 2019 · 4 comments · Fixed by #379
Closed

New operand XOR or MAX 1 #206

slalomsk8er opened this issue Feb 26, 2019 · 4 comments · Fixed by #379
Assignees
Labels
enhancement New feature or improvement
Milestone

Comments

@slalomsk8er
Copy link

Expected Behavior

I would like to define a node in which only one of 2 children is allowed to be OK at the same time.

CRITICAL + CRITICAL = CRITICAL
OK + CRITICAL = OK
CRITICAL + OK = OK
OK + OK = CRITICAL

Current Behavior

OR works for the first 3 cases.
MIN 1 works for the first 3 cases.
NOT works for the last 3 cases.

Possible Solution

Addition of a new operand - XOR or MAX 1.

Context

I have identical checks for a service on 2 servers but only one is allowed to run.
If both run race conditions and duplication of data could occur.

@nilmerg nilmerg changed the title Missing operand XOR or MAX 1 New operand XOR or MAX 1 Feb 28, 2019
@nilmerg nilmerg added the enhancement New feature or improvement label Feb 28, 2019
@nilmerg
Copy link
Member

nilmerg commented Feb 28, 2019

Hi,

thanks for the suggestion. That's definitely something I think is a good addition. Though, for now there's no chance it goes into the upcoming release. Maybe the next.

In case you can't wait, try this:

A = localhost;Hoststatus
display 0;A;A

NOT A = ! A
display 0;NOT A;NOT A

B = test-down-1;Hoststatus
display 0;B;B

NOT B = ! B
display 0;NOT B;NOT B

NOT A AND NOT B = NOT A & NOT B
display 0;NOT A AND NOT B;NOT A AND NOT B

NOT (NOT A AND NOT B) = ! NOT A AND NOT B
display 0;NOT (NOT A AND NOT B);NOT (NOT A AND NOT B)



A and B = A & B
display 0;A and B;A and B

NOT A AND B = ! A and B
display 0;NOT A AND B;NOT A AND B

XOR = NOT A AND B & NOT (NOT A AND NOT B)
display 1;XOR;XOR

🤣

@markuslf
Copy link

On my machine, the config workaround shown does not work for the scenario described above. The root node becomes CRITICAL if any of its nodes are CRITICAL, but should be OK.

@nilmerg
Copy link
Member

nilmerg commented Mar 11, 2022

Hm, works still fine for me:

All OK All CRITICAL One OK One CRITICAL
Screenshot from 2022-03-11 14-01-00 Screenshot from 2022-03-11 14-00-38 Screenshot from 2022-03-11 13-59-37

markuslf added a commit to Linuxfabrik/icingaweb2-module-businessprocess that referenced this issue Mar 11, 2022
@markuslf
Copy link

markuslf commented Mar 11, 2022

Strange... the workaround currently works for me too. Don't know what I have tested. I'm pretty sure it didn't work yesterday.

Nevertheless, I have submitted a pull request to implement "MAX 1" for the current development version.

@nilmerg nilmerg added the queue/wishlist Probable candidate for a future release label Jul 20, 2022
@nilmerg nilmerg linked a pull request Jul 20, 2022 that will close this issue
@nilmerg nilmerg added this to the 2.5.0 milestone Jul 11, 2023
@nilmerg nilmerg linked a pull request Jul 11, 2023 that will close this issue
@nilmerg nilmerg removed the queue/wishlist Probable candidate for a future release label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants