Xymon Mailing List Archive search

BBALPHAMSG truncated

15 messages in this thread

list Gorm J. Siiger · Tue, 29 Nov 2011 22:21:59 +0100 ·
I'm currently in the progress of upgrading/replacing my old hobbit version 4.2.0 to 4.3.4
I have installed on a brand new server and I'm just testing if everything is ok.

My SMS alert script seems to work ok, but the BBALPHAMSG variable seems to be truncated to around 12-16 characters, leaving the status messages incomplete.
I can easily add $DOWNSECS and/or $DOWNSECSMSG and they are added to the message which then is longer of cause.

The exact same script works on my old server, and by manually setting the variables I can send any text I like.

Anyone seen this behavior ?

----
Running on FreeBSD 8.2-RELEASE

From /var/log/xymon/alert.log:
2011-11-29 22:12:29 Paging script /usr/local/www/xymon/server/ext/kannel-sms.sh terminated by signal 60 (not sure if signal 60 is ok)
----

Best regards
Gorm
list Bill Arlofski · Wed, 30 Nov 2011 11:41:47 -0500 ·
quoted from Gorm J. Siiger
On 11/29/11 16:21, Gorm J. Siiger wrote:
I'm currently in the progress of upgrading/replacing my old hobbit version 4.2.0 to 4.3.4
I have installed on a brand new server and I'm just testing if everything is ok.

My SMS alert script seems to work ok, but the BBALPHAMSG variable seems to be truncated to around 12-16 characters, leaving the status messages incomplete.
I can easily add $DOWNSECS and/or $DOWNSECSMSG and they are added to the message which then is longer of cause.

The exact same script works on my old server, and by manually setting the variables I can send any text I like.

Anyone seen this behavior ?

Best regards
Gorm

Hi Gorm... I seem to be seeing the same thing here with v4.3.4

In my alerts.cfg file I have the FORMAT set to "SMS" like so:

--[snip]--
SCRIPT $xymon-sms-alert user-51522e88c0f2@xymon.invalid \
  TIME=$smsalerthours DURATION>5m FORMAT=SMS REPEAT=$never \
  COLOR=red RECOVERED STOP
--[snip]--

(with $never and the other variables defined above in alerts.cfg)

I wrote a custom alert script xymon-SMS-alert.sh  in which (for debugging
purposes) I write out some of the environment variables to a log file for each
alert sent.

In that script I also see that I had written a line to pull something specific
from the BBALPHAMSG for use in my email-to-SMS text message (not sure now
though what that might have been)

This line from my xymon-SMS-alert.sh was pulling everything starting at the
10th _space_ in the BBALPHAMSG, and then grabbing the first string before the
colon in the string that was left over:

--[snip]--
SMSTXT=`echo "$BBALPHAMSG" | cut -d' ' -f10- | cut -d':' -f1`
--[snip]--


Below are several examples of what BBALPHAMSG is being set to, which appear to
me to be truncated and/or missing information.  Each of them only has  3
strings separated by _spaces_ so my SMSTXT variable above ALWAYS evaluates to
null because it is first looking for everything after the 10th space. :)

--[snip]--
BBALPHAMSG=dhcp.example.org:conn red [52433

BBALPHAMSG=zimbra.example.org:memory RECOVERE

BBALPHAMSG=mvfilemaker.example.org:disk DISABLE
--[snip]--


To me it does appear that the SMS format seems to truncate the BBALPHAMSG
variable as shown above.

P.S. It is also possible that my SMSTXT variable was evaluating BBALPHAMSG
when the FORMAT was set to TEXT or SCRIPT during initial testing - both of
which would contain more information - and I had simply left it in there so
now I will have to test that theory too. :)


-- 
Bill Arlofski
Reverse Polarity, LLC
XXX-XXX-XXXX Office
http://www.revpol.com/
list Gorm J. Siiger · Wed, 30 Nov 2011 18:57:18 +0100 ·
quoted from Bill Arlofski
Below are several examples of what BBALPHAMSG is being set to, which appear to
me to be truncated and/or missing information.  Each of them only has  3
strings separated by _spaces_ so my SMSTXT variable above ALWAYS evaluates to
null because it is first looking for everything after the 10th space. :)

--[snip]--
BBALPHAMSG=dhcp.example.org:conn red [52433

BBALPHAMSG=zimbra.example.org:memory RECOVERE

BBALPHAMSG=mvfilemaker.example.org:disk DISABLE
--[snip]--


To me it does appear that the SMS format seems to truncate the BBALPHAMSG
variable as shown above.
Yes, thats exactely what I see - there must be some kind of message
evaluation in the FORMAT=SMS which fails.

Thanks for testing :)

-- 
Best regards
Gorm
list Bill Arlofski · Wed, 30 Nov 2011 13:35:34 -0500 ·
quoted from Gorm J. Siiger
On 11/30/11 12:57, Gorm J. Siiger wrote:
To me it does appear that the SMS format seems to truncate the BBALPHAMSG
variable as shown above.
Yes, thats exactely what I see - there must be some kind of message
evaluation in the FORMAT=SMS which fails.

Thanks for testing :)
Best regards
Gorm

Well, it was entirely coincidental that I was looking into my SMS messages at
about the exact time you wrote your message. I had just installed a new SMS
app on my phone yesterday and was paying more attention to the content of the
SMS messages I was receiving which led me to investigate my script. :)

Cheers!

-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
list Henrik Størner · Tue, 06 Dec 2011 15:32:51 +0100 ·
quoted from Gorm J. Siiger
On 29-11-2011 22:21, Gorm J. Siiger wrote:
I'm currently in the progress of upgrading/replacing my old hobbit version 4.2.0 to 4.3.4
I have installed on a brand new server and I'm just testing if everything is ok.

My SMS alert script seems to work ok, but the BBALPHAMSG variable seems to be truncated to around 12-16 characters, leaving the status messages incomplete.
I can easily add $DOWNSECS and/or $DOWNSECSMSG and they are added to the message which then is longer of cause.

Does the attached patch solve it ? Against 4.3.6.


Regards,
Henrik
Attachments (1)
list Bill Arlofski · Tue, 06 Dec 2011 16:49:15 -0500 ·
quoted from Henrik Størner
On 12/06/11 09:32, Henrik Størner wrote:
On 29-11-2011 22:21, Gorm J. Siiger wrote:
I'm currently in the progress of upgrading/replacing my old hobbit version
4.2.0 to 4.3.4
I have installed on a brand new server and I'm just testing if everything is
ok.

My SMS alert script seems to work ok, but the BBALPHAMSG variable seems to
be truncated to around 12-16 characters, leaving the status messages
incomplete.
I can easily add $DOWNSECS and/or $DOWNSECSMSG and they are added to the
message which then is longer of cause.

Does the attached patch solve it ? Against 4.3.6.
Hi Henrik.  Thanks for the quick patch butI am not sure that his completely
fixed the issue.  For example, it appears that the first line now looks OK:

I run a printenv > /tmp/SMS>log in my alert script, and BBALPHAMSG looks like:

BBALPHAMSG=host.example.com:cpu yellow [800718]
&yellow Load is HIG


^^^^^--- Is that 2nd line to supposed to be there or is this an IFS issue on
my end?  Either way, it appears just like that with the second line starting
with the & and it also appears to be truncated at the 2nd "H" in HIGH


What is the format of the BBALPHAMSG supposed to look like (eg: the format and
list of fields) when FORMAT=SMS so I know what I am looking for as we move
forward?

Thanks!

--
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
list Bill Arlofski · Tue, 06 Dec 2011 16:53:26 -0500 ·
Henrik... I think I spoke too soon... on recovery,  BBALPHAMSG looks like:

--[snip]--
BBALPHAMSG=host.example.com:cpu RECOVERE
--[snip]--

This is patched 4.3.6

-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
list Henrik Størner · Tue, 06 Dec 2011 23:03:26 +0100 ·
quoted from Bill Arlofski
On 06-12-2011 22:49, Bill Arlofski wrote:
I run a printenv>  /tmp/SMS>log in my alert script, and BBALPHAMSG looks like:

BBALPHAMSG=host.example.com:cpu yellow [800718]
&yellow Load is HIG


^^^^^--- Is that 2nd line to supposed to be there or is this an IFS issue on
my end?  Either way, it appears just like that with the second line starting
with the&  and it also appears to be truncated at the 2nd "H" in HIGH


What is the format of the BBALPHAMSG supposed to look like (eg: the format and
list of fields) when FORMAT=SMS so I know what I am looking for as we move
forward?
The SMS format should be like this:

HOSTNAME:TESTNAME COLOR [ACK-COOKIE]

followed by any lines in the status message that begin with "&red", 
"&yellow" or "&purple".

It would be interesting to see the full status message. Could you run 
this command while some of the alerts happen:

   xymoncmd xymond_channel --channnel=page cat >/var/tmp/alertfeed.txt

and then pick out one or more of the problem alert messages and send to me ?


Thanks,
Henrik
list Bill Arlofski · Wed, 07 Dec 2011 16:02:40 -0500 ·
quoted from Henrik Størner
On 12/06/11 17:03, Henrik Størner wrote:
It would be interesting to see the full status message. Could you run this
command while some of the alerts happen:

  xymoncmd xymond_channel --channnel=page cat >/var/tmp/alertfeed.txt

and then pick out one or more of the problem alert messages and send to me ?


Thanks,
Henrik
Requested information sent to private email.

--
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
list Henrik Størner · Wed, 07 Dec 2011 22:46:38 +0100 ·
quoted from Bill Arlofski
On 07-12-2011 22:02, Bill Arlofski wrote:
On 12/06/11 17:03, Henrik Størner wrote:
It would be interesting to see the full status message. Could you run this
command while some of the alerts happen:

   xymoncmd xymond_channel --channnel=page cat>/var/tmp/alertfeed.txt
quoted from Bill Arlofski

and then pick out one or more of the problem alert messages and send to me ?
Requested information sent to private email.
Very helpful, thanks. This patch should put the final touches on fixing 
this bug.


Regards,
Henrik
Attachments (1)
list Bill Arlofski · Thu, 08 Dec 2011 09:29:12 -0500 ·
quoted from Henrik Størner
On 12/07/11 16:46, Henrik Størner wrote:
On 07-12-2011 22:02, Bill Arlofski wrote:
Requested information sent to private email.
Very helpful, thanks. This patch should put the final touches on fixing this bug.
Hi Henrik, just a quick question.

Do I need to apply this patch to xymond/do_alert.c along with the smaller
patch that you posted on Dec 6 2011, or just this new one?

In other words, will you be backing the previous patch out, or is it also
required as part of a complete fix for this truncating of BBALPHAMSG issue?

I will patch accordingly, then test and report back as soon as I hear from you.

Thanks!

--
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
list Henrik Størner · Thu, 08 Dec 2011 15:32:18 +0100 ·
On Thu, 08 Dec 2011 09:29:12 -0500, Bill Arlofski
<user-0b8af203a56e@xymon.invalid>
quoted from Bill Arlofski
wrote:
On 12/07/11 16:46, Henrik Størner wrote:
On 07-12-2011 22:02, Bill Arlofski wrote:
Requested information sent to private email.
Very helpful, thanks. This patch should put the final touches on fixing
this bug.
Hi Henrik, just a quick question.

Do I need to apply this patch to xymond/do_alert.c along with the
smaller
patch that you posted on Dec 6 2011, or just this new one?
The new one goes on top of the previous one, so no backing out any
patches.


Regards,
Henrik
list Bill Arlofski · Thu, 08 Dec 2011 17:12:36 -0500 ·
quoted from Henrik Størner
On 12/08/11 09:32, user-ce4a2c883f75@xymon.invalid wrote:
On Thu, 08 Dec 2011 09:29:12 -0500, Bill Arlofski
<user-0b8af203a56e@xymon.invalid>
wrote:
On 12/07/11 16:46, Henrik Størner wrote:
On 07-12-2011 22:02, Bill Arlofski wrote:
Requested information sent to private email.
Very helpful, thanks. This patch should put the final touches on fixing
this bug.
Hi Henrik, just a quick question.

Do I need to apply this patch to xymond/do_alert.c along with the
smaller
patch that you posted on Dec 6 2011, or just this new one?
The new one goes on top of the previous one, so no backing out any
patches.


Regards,
Henrik
This appears to have fixed it. Since I applied it, I have not seen a single
issue with the BBALPHAMSG being truncated including the additional lines that
start with &COLOR .....

Thanks!

-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
list James Lose · Tue, 20 Dec 2011 13:41:27 -0500 ·
This problem can be corrected by editing the do_alerts.c file, and rebuilding the xymond_alert executable.

diff do_alert.c do_alert.c.orig
527c527
<                                       snprintf(bbalphamsg, msglen+1, "BBALPHAMSG=%s", p);
---
                                      snprintf(bbalphamsg, msglen, "BBALPHAMSG=%s", p);
Bob Dobbs


This E-mail and any of its attachments may contain Time Warner Cable proprietary information, which is privileged, confidential, or subject to copyright belonging to Time Warner Cable. This E-mail is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient of this E-mail, you are hereby notified that any dissemination, distribution, copying, or action taken in relation to the contents of and attachments to this E-mail is strictly prohibited and may be unlawful. If you have received this E-mail in error, please notify the sender immediately and permanently delete the original and any copy of this E-mail and any printout.
list Henrik Størner · Tue, 20 Dec 2011 21:52:55 +0100 ·
quoted from James Lose
On 20-12-2011 19:41, Lose, James wrote:
This problem can be corrected by editing the do_alerts.c file, and
rebuilding the xymond_alert executable.

diff do_alert.c do_alert.c.orig

527c527

<snprintf(bbalphamsg, msglen+1, "BBALPHAMSG=%s", p);

---
snprintf(bbalphamsg, msglen, "BBALPHAMSG=%s", p);
Yep, this problem was fixed in the 4.3.7 release.


Regards,
Henrik