smokeping报警脚本简单 短信+邮件

#!/bin/bash
# Smokeping Alerts
date=`/usr/bin/date`
alertname=$1
target=$2
losspattern=$3
rttpattern=$4
hostname=$5
################################Message Alert#################################
/usr/bin/curl -s -d "biz_type=sa_warn" -d "mobile=11111111111" --data-urlencode "content= $alertname : $target is $hostname losspattern is $losspattern " "http://192.168.1.1:8080/notify/sms/send_warn_sms"


################################Mail Alert####################################
echo " $date
$alertname : $target is $hostname losspattern is $losspattern "|mail -s test hanlei@zuishuai.com

原文地址:https://www.cnblogs.com/han1094/p/7116623.html