Xymon Mailing List Archive search

status+LIFETIME in 4.2-RC-20060712

5 messages in this thread

list Ralph Mitchell · Thu, 3 Aug 2006 06:59:55 -0500 ·
I hope someone can tell me what I'm doing wrong here...  I've got a
very simple script:

   #!/bin/sh

   COLUMN=lifetime
   COLOR=red

   MSG="All is OK"

   $BB $BBDISP "status+30 $MACHINE.$COLUMN $COLOR `date`

   ${MSG}
   "
   exit

which is run from hobbitlaunch.cfg with this entry:

   [lifetime]
        ENVFILE /home/hobbit/client/etc/hobbitclient.cfg
        NEEDS hobbitd
        CMD /home/hobbit/checkouts/lifetime-test.sh
        LOGFILE $BBSERVERLOGS/hobbitclient.log
        INTERVAL 1m

I entered two IP addresses in the hobbitclient.cfg file:

   BBDISP="0.0.0.0"
   BBDISPLAYS="10.1.1.1   10.1.1.2"

The first address is the hobbit server where the script is running,
the other is a remote hobbit server.  Both are running the same RC
release.

What's happening is:  the RED status is received by the local server
and display.  It is not displayed on the remote server.  If I take the
+30 out of the message, both servers display the correct status.

Either I've misunderstood what's supposed to be happening, or the
remote server isn't handling the "status+N" properly.

Ralph Mitchell
list Henrik Størner · Thu, 3 Aug 2006 14:44:08 +0200 ·
On Thu, Aug 03, 2006 at 06:59:55AM -0500, Ralph Mitchell wrote:
I hope someone can tell me what I'm doing wrong here...
I cannot see anything immediately wrong. And I can reproduce the problem
here. Stay tuned ...


Regards,
Henrik
list Tom Kauffman · Thu, 3 Aug 2006 09:43:09 -0400 ·
OK -- this explains something I've seen here but not had the time to
research.

FWIW, this has existed since 4.03, Henrik.

Tom Kauffman
NIBCO, Inc
quoted from Henrik Størner

-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] Sent: Thursday, August 03, 2006 8:44 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] status+LIFETIME in 4.2-RC-20060712

On Thu, Aug 03, 2006 at 06:59:55AM -0500, Ralph Mitchell wrote:
I hope someone can tell me what I'm doing wrong here...
I cannot see anything immediately wrong. And I can reproduce the problem
here. Stay tuned ...


Regards,
Henrik


CONFIDENTIALITY NOTICE:  This email and any attachments are for the exclusive and confidential use of the intended recipient.  If you are not
the intended recipient, please do not read, distribute or take action in reliance upon this message. If you have received this in error, please notify us immediately by return email and promptly delete this message and its attachments from your computer system. We do not waive  attorney-client or work product privilege by the transmission of this
message.
list Henrik Størner · Thu, 3 Aug 2006 20:29:10 +0200 ·
quoted from Tom Kauffman
On Thu, Aug 03, 2006 at 02:44:08PM +0200, Henrik Stoerner wrote:
On Thu, Aug 03, 2006 at 06:59:55AM -0500, Ralph Mitchell wrote:
I hope someone can tell me what I'm doing wrong here...
I cannot see anything immediately wrong. And I can reproduce the problem
here. Stay tuned ...
It was a combination of having multiple servers in BBDISPLAYS, and
the use of a lifetime setting on the status message. Patch attached.


Regards,
Henrik

-------------- next part --------------
--- lib/sendmsg.c	2006/07/20 16:06:41	1.80
+++ lib/sendmsg.c	2006/08/03 18:26:47
@@ -419,8 +419,9 @@
 {
 	int result = 0;
 
-	if (strcmp(onercpt, "0.0.0.0") != 0)
+	if (strcmp(onercpt, "0.0.0.0") != 0) {
 		result = sendtobbd(onercpt, msg, respfd, respstr, fullresponse, timeout);
+	}
 	else if (morercpts) {
 		char *bbdlist, *rcpt;
 		int first = 1;
@@ -473,7 +474,7 @@
 	scheduleaction = ((strncmp(msg, "schedule", 8) == 0) && (strlen(msg) > 8));
 
 	/* See if this is a multi-recipient command */
-	i = strcspn(msg, " \t\r\n");
+	i = strspn(msg, "abcdefghijklmnopqrstuvwxyz");
 	msgcmd = (char *)malloc(i+1);
 	strncpy(msgcmd, msg, i); *(msgcmd+i) = '\0';
 	for (i = 0; (multircptcmds[i] && strcmp(multircptcmds[i], msgcmd)); i++) ;
list Ralph Mitchell · Thu, 3 Aug 2006 15:51:37 -0500 ·
quoted from Henrik Størner
On 8/3/06, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
On Thu, Aug 03, 2006 at 02:44:08PM +0200, Henrik Stoerner wrote:
On Thu, Aug 03, 2006 at 06:59:55AM -0500, Ralph Mitchell wrote:
I hope someone can tell me what I'm doing wrong here...
I cannot see anything immediately wrong. And I can reproduce the problem
here. Stay tuned ...
It was a combination of having multiple servers in BBDISPLAYS, and
the use of a lifetime setting on the status message. Patch attached.
Excellent!!  I've just tried it and it works as advertised.

Thanks,

Ralph Mitchell