[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] Remove square brackets from Alerts



Hi Allan,

We do encode square brackets before calling our sms_client exectutable.

-----------
# Alert message.
# Extract first error line from the received message text.
# SMS is limited to 160 char.
# We allow 30 char. for the $BBHOSTNAME:$BBSVCNAME [$ACKCODE] stuff.
# It remains 130 for the $LINE.
LINE=`echo "$BBALPHAMSG" | grep "&${BBCOLORLEVEL}" | head -1`
LINE=`echo "$LINE" | sed -e "s/&${BBCOLORLEVEL} //g"`
LINE=`echo "$LINE" | cut -c1-130`

# "[" and "]" must be encoded as 27(ESC) 60 and 27 62 respectively
# This is achieved in vi using CTRL-V ESC < and CTRL-V ESC >
# For details in 7 bit default alphabet specified in GSM,
# see http://www.visualgsm.com/bit_default_alphabet.htm
SMS_MSG="$BBHOSTNAME:$BBSVCNAME ^[<$ACKCODE^[>
$LINE"
------------


Dominique


Allan Spencer wrote:
Hi,

Ive had a bit of a hunt around for this but didnt find anything. We're in the process of looking at a new email-to-sms provider and just found out that square brackets and a bunch of others are not supported so I need to know if I can remove them from the alert code or somehow generate the message in a way that it doesnt send them.

Currently I basically have the following

HOST=*
SCRIPT /home/monitor/server/bin/smsalert.sh 04xxxxxxxx reapt=15m duration=>10m recovered format=sms

and the smsalert.sh
echo "${BBALPHAMSG:0:160}" | gnokii --sendsms "$RCPT"

It all works fine and comes out as host.domain.com:svcs red [ackcode[ which is where the problem is. I had a plan originally to be able to reply back to the msg and ack the alert but currently its not being used so removing the ack code is an option but my preference is to remove the brackets if possible.

If anyone could assist it would be greatly appreciated

Cheers

Allan

To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe (at) hswn.dk