[Xymon] BBALPHAMSG truncated

Bill Arlofski waa-hobbitml at revpol.com
Wed Nov 30 17:41:47 CET 2011


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 email-to-txt-svc at example.com \
  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
860-824-2433 Office
http://www.revpol.com/



More information about the Xymon mailing list