Xymon Mailing List Archive search

badTEST:x:y:z not working

4 messages in this thread

list Michael Heinecke · Thu, 11 Aug 2005 13:46:16 +0200 ·
Dear all,
 looks to me, as if the "badTEST:x:y:z" tags are not working.  I.e. "badssh:1:2:3" turns immediatley red if ssh goes down at the monitored host.  I've looked into bbtest-net.c and figured out, that ..
 - At line 775, the for loop << "for (swalk=svchead; (swalk && strcmp(swalk->testname, testname)); swalk = swalk->next) >>
compares swalk->testname and testname ---> which are never equal, because the string testname always includes the :x.y:z settings and swalk->testname (of course) not.
 Hmmm... your experiences? I've found no posting about this kind of issue on the list, and i think "badTEST" is one of the most important tags.  I'am using 4.1.1 (4.1.2 (snapshot 09.08.05  also testet - same effect) @ Linux (Debian sarge and Solaris 8
 :-) Thx! Michael
Michael Heinecke
CAX / UNIX&VoD

HanseNet Telekommunikation GmbH
Überseering 33 a, 22297 Hamburg
Telefon: +49 (0)40 23726-2768
Telefax: +49 (0)40 23726-3485

http://www.alice-dsl.de <http://www.alice-dsl.de/>; , http://www.hansenet.de <http://www.hansenet.de/>;
list Henrik Størner · Thu, 11 Aug 2005 15:49:01 +0200 ·
quoted from Michael Heinecke
On Thu, Aug 11, 2005 at 01:46:16PM +0200, user-c9ab24a501e1@xymon.invalid wrote:
Dear all,
 
looks to me, as if the "badTEST:x:y:z" tags are not working. 
 
I.e. "badssh:1:2:3" turns immediatley red if ssh goes down at the monitored host. 
There has been some reports about this, but I never got around to
looking into exactly what caused it.
quoted from Michael Heinecke
I've looked into bbtest-net.c and figured out, that ..
 
- At line 775, the for loop << "for (swalk=svchead; (swalk && strcmp(swalk->testname, testname)); swalk = swalk->next) >>
compares swalk->testname and testname ---> which are never equal, because the string testname always includes the :x.y:z settings and swalk->testname (of course) not.
Aha - that would explain it.

I think this patch should fix it, then.


Henrik

-------------- next part --------------
--- bbnet/bbtest-net.c	2005/08/10 15:13:21	1.220
+++ bbnet/bbtest-net.c	2005/08/11 13:42:56
@@ -773,9 +773,12 @@
 			if (timespec) inscope = periodcoversnow(timespec);
 
 			if (strlen(testname) && badcounts && inscope) {
+				char *p;
 				twalk = NULL;
 
+				p = strchr(testname, ':'); if (p) *p = '\0';
 				for (swalk=svchead; (swalk && strcmp(swalk->testname, testname)); swalk = swalk->next) ;
+				if (p) *p = ':';
 				if (swalk) {
 					if (swalk == httptest) twalk = h->firsthttp;
 					else if (swalk == ldaptest) twalk = h->firstldap;
list Frédéric Mangeant · Thu, 11 Aug 2005 16:31:57 +0200 ·
quoted from Henrik Størner
Henrik Stoerner a écrit :
On Thu, Aug 11, 2005 at 01:46:16PM +0200, user-c9ab24a501e1@xymon.invalid wrote:
 
Dear all,

looks to me, as if the "badTEST:x:y:z" tags are not working. 
I.e. "badssh:1:2:3" turns immediatley red if ssh goes down at the monitored host.    
There has been some reports about this, but I never got around to
looking into exactly what caused it.
 
Hi Henrik

I have 2 questions about badTEST :

- if I want a test to go yellow at the 1st failure and red at the 2nd, is the syntax "badTEST:1:1:2" correct ?

I had problems with bbgen 2.16 (some tests went red at the 1st failure). With the patch you posted and latest 4.1.2 snapshot, I get this

yellow for 00:53
and then red

Is it because "bbretest" runs every minute ?


- if I want ALL my network tests to go yellow at the 1st failure and red at the 2nd, can I add this at the top of my bb-hosts :

0.0.0.0         .default.       # badconn:1:1:2 badftp:1:1:2 badtelnet:1:1:2 [...]


Thanks in advance for your answers.

-- 

Frédéric Mangeant

Steria EDC Sophia-Antipolis
list Eric van de Meerakker · Tue, 23 Aug 2005 09:56:32 +0200 ·
Hello Henrik,


Just to confirm this: your patch seems to be working OK. I set
"badhttp:0:1:2" and have now seen the http test go from green to yellow
before turning red.

Thanks! This will keep down the number of false alerts.


Eric

mail to : user-004bb4e22963@xymon.invalid
phone   : +XX (X)XX XXX XXXX
fax     : +XX (X)XX XXX XXXX
quoted from Henrik Størner


-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Thursday, August 11, 2005 3:49 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] badTEST:x:y:z not working

On Thu, Aug 11, 2005 at 01:46:16PM +0200, user-c9ab24a501e1@xymon.invalid wrote:
Dear all,
 
looks to me, as if the "badTEST:x:y:z" tags are not working. 
 
I.e. "badssh:1:2:3" turns immediatley red if ssh goes down at the
monitored host. 
There has been some reports about this, but I never got around to
looking into exactly what caused it.
I've looked into bbtest-net.c and figured out, that ..
 
- At line 775, the for loop << "for (swalk=svchead; (swalk &&
strcmp(swalk->testname, testname)); swalk = swalk->next) >>
compares swalk->testname and testname ---> which are never equal, because
the string testname always includes the :x.y:z settings and swalk->testname
(of course) not.

Aha - that would explain it.

I think this patch should fix it, then.


Henrik