Xymon Mailing List Archive search

combo.cfg: integer arithmetic and comparisons broken

list Andy Smith
Sun, 11 Oct 2015 13:19:15 +0100
Message-Id: <user-cab323646e87@xymon.invalid>

All,

It seems that since revision 7092, this construction mentioned in the man pages no longer works:-

	WebCluster.http = (Web1.http + Web2.http + Web3.http) >= 2

I think this patch solves the above issue and hasn't adversely affected any of our other combo tests :-

diff -c xymond/combostatus.c.FCS xymond/combostatus.c
*** xymond/combostatus.c.FCS    2015-05-13 10:16:32.000000000 -0400
--- xymond/combostatus.c        2015-10-11 07:38:59.000000000 -0400
***************
*** 287,293 ****

         done = 0; inp=symbolicexpr; outp=expr; symp = NULL;
         while (!done) {
!               if (isalpha((int)*inp) || (isdigit((int)*inp) && *(inp+1) && (*(inp+1) > ' ') && *(inp+2) && (*(inp+2) > ' ')) ) { /* puke */
                         if (!insymbol) { insymbol = 1; symp = symbol; }
                         *symp = *inp; symp++;
                 }
--- 287,293 ----

         done = 0; inp=symbolicexpr; outp=expr; symp = NULL;
         while (!done) {
!               if (isalpha((int)*inp) || (isdigit((int)*inp) && insymbol && *(inp+1) && (*(inp+1) > ' ') && *(inp+2) && (*(inp+2) > ' ')) ) {  /* puke */
                         if (!insymbol) { insymbol = 1; symp = symbol; }
                         *symp = *inp; symp++;
                 }

Thanks
-- 
Andy