Xymon Mailing List Archive search

combo.cfg: integer arithmetic and comparisons broken

3 messages in this thread

list Andy Smith · Sun, 11 Oct 2015 13:19:15 +0100 ·
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
list John Thurston · Mon, 12 Oct 2015 13:54:01 -0800 ·
quoted from Andy Smith
On 10/11/2015 4:19 AM, Andy Smith wrote:
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
In what way does it fail?
On xymon 4.3.21 solaris 10, it seems to be working fine.

-- 
    Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska
list Andy Smith · Tue, 13 Oct 2015 00:43:26 +0100 ·
quoted from John Thurston
John Thurston wrote:
On 10/11/2015 4:19 AM, Andy Smith wrote:
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
In what way does it fail?
On xymon 4.3.21 solaris 10, it seems to be working fine.
Interesting, this does indeed run clean on solaris, but on linux, I get 
the following (note that the test remained green because the expression 
'>=3' got converted to '(1+1+1)>=0':-

$ uname -a
Linux angelica.shadymint.com 2.6.32-279.5.1.el6.i686 #1 SMP Tue Aug 14 
21:14:52 UTC 2012 i686 i686 i386 GNU/Linux


$ tail -1 combo.cfg
angelica.shadymint.com.combo=(angelica.shadymint.com.http + 
angelica.shadymint.com.bbd + angelica.shadymint.com.procs)>=3

$ combostatus --debug --no-update
6736 2015-10-13 00:39:07.262866 Opening file 
/apps/xymon/server/etc/combo.cfg
6736 2015-10-13 00:39:07.263065 Transport setup is:
6736 2015-10-13 00:39:07.263077 xymondportnumber = 1984
6736 2015-10-13 00:39:07.263082 xymonproxyhost = NONE
6736 2015-10-13 00:39:07.263086 xymonproxyport = 0
6736 2015-10-13 00:39:07.263090 Recipient listed as 'n.n.n.n'
6736 2015-10-13 00:39:07.263095 Standard protocol on port 1984
6736 2015-10-13 00:39:07.263108 Will connect to address n.n.n.n port 1984
6736 2015-10-13 00:39:07.263396 Connect status is 0
6736 2015-10-13 00:39:07.263444 Sent 42 bytes
6736 2015-10-13 00:39:07.263646 Read 636 bytes
6736 2015-10-13 00:39:07.263671 Closing connection
2015-10-13 00:39:07.263726 Item '3' has no testname part
2015-10-13 00:39:07.263762 Item '3' has no testname part
2015-10-13 00:39:07.263769 Invalid data for symbol calculation - missing 
host/testname: 3
6736 2015-10-13 00:39:07.263777 Symbolic 
'(angelica.shadymint.com.http+angelica.shadymint.com.bbd+angelica.shadymint.com.procs)>=3' 
converted to '(1+1+1)>=0'
2015-10-13 00:39:07.263812 Item '3' has no testname part
2015-10-13 00:39:07.263820 Item '3' has no testname part
6736 2015-10-13 00:39:07.263828 Adding to combo msg: status 
angelica,shadymint,com.combo green Tue Oct 13 00:39:07 2015

-- 
Andy