status+LIFETIME in 4.2-RC-20060712
list Ralph Mitchell
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
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
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
▸
-----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
▸
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
▸
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