当前位置:
Nagios飞信linux短信报警脚本配置
时间:2025-11-04 00:09:01 出处:系统运维阅读(143)

复制 vi sendsms.sh #!/bin/bash fetionDir=/usr/local/fetion/ cd $fetionDir DIR=`pwd` user=13724506486 pwd=gjb88888 for phone in `cat $DIR/phonelist.txt` do echo "$phone" | sed ‘/^[ \t]*$/d’ | sed ‘s/^[ \t]*//’ | sed ‘s/[ \t]*$//’ | grep ‘^1[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]‘ if (($?飞信 == 0 ));then if [[ -f $DIR/msg.txt ]];then echo "================" >> msg.txt fi phone=`echo "$phone" | sed ‘s/^[ \t]*//’ | sed ‘s/[ \t]*$//’` echo "sms $phone $1" >> $DIR/msg.txt echo "quit" >> $DIR/msg.txt $fetionDir/fetion –mobile=$user –pwd=$pwd –to=$phone –msg-utf8="$1" else continue fi done 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.
分享到:
温馨提示:以上内容和图片整理于网络,仅供参考,希望对您有帮助!如有侵权行为请联系删除!