Xymon Mailing List Archive search

Custom alert mail with script

list 谈工作
Thu, 8 Sep 2016 21:58:09 +0800
Message-Id: <CANbTsTq0gvhK3ZTK8B1BjtwxJO12EjL7d2j=11ur=user-c044c39b8039@xymon.invalid>

Hi there

I have been working on custom alert script for days, but it just doesn't
work.

Here is my config in alerts.cfg(based on the man page):

HOST=*  SERVICE=cpu,disk,memory,files COLOR=red,yellow
     #MAIL user-b75305ea6ec0@xymon.invalid RECOVERED #This one works fine.
     SCRIPT /home/xymon/RedAlert.sh user-b75305ea6ec0@xymon.invalid FORMAT=sms

And here is my script(based on
http://lists.xymon.com/pipermail/xymon/2011-May/031660.html):

#!/usr/bin/sh
CALL_LEVEL="存在异常"
ASK_LEVEL="请您关注。"
RCPT=$1
[ "$BBCOLORLEVEL" = "RED" ] && ASK_LEVEL="情况严重,请立即处理。"
[ "$BBCOLORLEVEL" = "RED" ] && CALL_LEVEL="严重告警"
echo "告警主机$BBHOSTNAME ,IP地址为$MACHIP,告警项目:$BBSVCNAME,$ASK_LEVEL
持续时长:$DOWNSECS。
相关日志详情:
$BBALPHAMSG" | mail -s "$MACHIP 的 $BBSVCNAME $CALL_LEVEL【Xymon监控】" $RCPT

The alert.log keep logging:
Could not launch paging script /home/xymon/RedAlert.sh: No such file or
directory

I have checked the file permission (-rwxrwxr-x), and when I run:
sh /home/xymon/RedAlert.sh user-b75305ea6ec0@xymon.invalid
with user xymon, I receive what i want  immediately.

Would someone please help me out of this?
Thanks a lot.