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