SMS to long
list Dirk Kastens
Hi, alerting via SMS is working fine, generally. But there is a problem with one webserver, that has a very long URL. Xymon is sending the following message: my.web.server:http red [654381] &red https://a&very&long&url - Connection refused The resulting message has 189 characters. That is, why the SMS always gets rejected by our SMS server. Is there a way to shorten the URL that is sent in the alert message? Thanks, Dirk
list Dirk Kastens
Hi,
Don't know if you had a reaction but you can use the cut command to maximize the message.
OK, but this would only work with an external script. We use MAIL with FORMAT=sms. Meanwhile we have shortened the URL that is tested by xymon. Now we are below the 160 character limit. Dirk
list Jeremy Laidman
▸
On 14 August 2013 22:36, Dirk Kastens <user-e4253f8fc63b@xymon.invalid>wrote:
OK, but this would only work with an external script. We use MAIL with FORMAT=sms. Meanwhile we have shortened the URL that is tested by xymon. Now we are below the 160 character limit.
You could change from MAIL to SCRIPT, and have the script call $MAIL for you, after shortening URLs or whatever you wanted. Or you could redefine MAIL (in xymonserver.cfg) to do a similar thing. The example below will remove the first URL it finds, plus anything after the first 160 chars of what's left, and finally it will ensure that the last character is a newline (as some MTAs or MUAs might expect this to be the case): MAILC="/usr/bin/sed 's,https://[^ ]* ,,' | /bin/dd bs=1 count=160 2>/dev/null | /usr/bin/sed '$s/.$/\n/' | mail" J
list Dirk Kastens
MAILC="/usr/bin/sed 's,https://[^ ]* ,,' | /bin/dd bs=1 count=160 2>/dev/null | /usr/bin/sed '$s/.$/\n/' | mail"
Hey, that's great. Thanks a lot. Dirk