Xymon Mailing List Archive search

[Possible Spam] Parenthesis failure in combo.cfg

list Andy Smith
Sun, 11 Oct 2015 13:22:14 +0100
Message-Id: <user-44e70bba7c2b@xymon.invalid>

John Thurston wrote:
I'm pulling what little hair I have over the behavior of combostatus with parenthesis in combo.cfg

The man file specifically says, "All operators have EQUAL PRECEDENCE. If you need something evaluated in a specific order, use parentheses to group the expressions..."  I need to implement an exclusive-or, so certainly need to ensure the order of operations. But I couldn't make it work, so I started simplifying my expression to find where it broke. The failure conditions are pretty depressing :(

This simple expression works as expected
 foo.x = bar.a && zab.a
as does
 foo.x = bar.a && (zab.a==0)

but it fails with a core dump if I simply reverse the terms
 foo.x = (zab.a==0) && bar.a
it also dumps core if I wrap the earlier expression in parens
 foo.x = (bar.a && (zab.a==0))

it works with extra parens for a simple term
 foo.x = ((bar.a))
but dumps core there if a more complex expression in the parens
 foo.x = ((bar.a==0))

I am unable to come up with a way to implement anything useful with these limitations. I do understand that combostatus is kind of a fringe feature, but there are so many business functions it enables that I really want it to work!

I'm running 4.3.21 on Solaris 10. Is combostatus working for anyone else?
John,

The Revision ID of combostatus.c at 4.3.17 was 7092, there have been two changes since then, and I am about to submit a third to solve another problem that I have, but whilst I was researching my change, I didn't see anything particular that would apply to Solaris.  Could you test my patch please because I am nervous about extending something already labeled as 'ugly'.
-- 
Andy