combo.cfg: integer arithmetic and comparisons broken
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
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 907-465-8591 John.Thurston at alaska.gov Enterprise Technology Services Department of Administration State of Alaska
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) >= 2In 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
participants (2)
-
abs@shadymint.com
-
john.thurston@alaska.gov