vim /etc/zabbix/alert.d/zabbix-alert-sms-twilio.sh
#!/usr/bin/python import sys from twilio.rest import TwilioRestClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "AC0axxxxxxxxxxxxxxxxxxxx296ae" auth_token = "93e4xxxxxxxxxxxxxxxxxxx63e9" client = TwilioRestClient(account_sid, auth_token) message = client.messages.create(body=sys.argv[2], to=sys.argv[1], from_="+16572338xx8") # Replace with your Twilio number print message.sid |
vim /etc/zabbix/alert.d/zabbix-alert-call-twilio.sh
#!/usr/bin/python import sys import urllib from twilio.rest import TwilioRestClient # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "AC0axxxxxxxxxxxxxxxxxxxx296ae" auth_token = "93e4xxxxxxxxxxxxxxxxxxx63e9" client = TwilioRestClient(account_sid, auth_token) TwiML="http://yemaosheng.com/getTwiML.php?say="+urllib.quote(sys.argv[2]) call = client.calls.create(to=sys.argv[1], from_="+16572338xx8", url=TwiML) print call.sid |
vim /var/www/html/getTwiML.php
<?xml version="1.0" encoding="UTF-8"?> <Response> <Say voice="woman"><?php echo htmlspecialchars($_GET['say']); ?></Say> <Hangup/> </Response> |
订阅连接失效了?
哦是的,刚发现.改了.
另外rss全文输出嘛