icingaweb2-module-businessprocess
icingaweb2-module-businessprocess copied to clipboard
New operand XOR or MAX 1
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.
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
:rofl:
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.
Hm, works still fine for me:
All OK | All CRITICAL | One OK One CRITICAL |
---|---|---|
![]() |
![]() |
![]() |
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.