zabbix4.0短信告警配置

#!/usr/bin/env python3
import requests
import sys
#http://utf8.api.smschinese.cn/?Uid=USERNAME&Key=KEY&smsMob=NUMBERS&smsText=MESSAGE
def sendsms(USERNAME, KEY, NUMBERS, MESSAGE):
    url="http://utf8.api.smschinese.cn/"
    data = {
        "Uid" : USERNAME,
        "Key" : KEY,
        "smsMob" : NUMBERS,
        "smsText" : MESSAGE
    }
    requests.post(url,params=data)


if __name__ == "__main__":
    USERNAME = "gaoyuanzhi"
    KEY = "d41d8cd98f00b204e980"
    NUMBERS = sys.argv[1]
    MESSAGE = sys.argv[2]
    sendsms(USERNAME, KEY, NUMBERS, MESSAGE)

 

转载于:https://www.cnblogs.com/gaoyuanzhi/p/10097569.html

你可能感兴趣的:(zabbix4.0短信告警配置)