Zabbix sending text messages through scripts

Source: Internet
Author: User

Zabbix text message by script principle

and Zabbix e-mail is the same, are configured in action, the way to send text messages by calling SMS Company API to complete, of course, there are many online use 139 mailbox to send, this is actually called a call email, here is to repeat the method called script.

Step
    1. Write a script that sends text messages. Plus executable permissions.
    2. Administration-> Medis types inside Create, type Select script, fill in your script name.
    3. Specify Alertscriptspath in the server's configuration file. Note that this directory can be accessed by Zabbix.
    4. Restart the server.
    5. Configured in action.
    6. The individual user's media is configured with a mobile phone number.

Finally, attach a Python script

#!/usr/bin/python#coding: Utf-8ImportUrllib2ImportUrllibImportSys def sendm(mobile,content):URL =' http://xxx/sms.aspx 'data = Urllib.urlencode ({"userid":' xx ',"Account":' xx ',"Password":' xxx ',"mobile": Mobile,"Content": Content,"Sendtime":"","Action":"Send","Extno":""}) req = Urllib2. Request (url,data) res = Urllib2.urlopen (req)PrintRes.read () number=sys.argv[1]msg=sys.argv[2]SENDM (NUMBER,MSG)

In fact, in many cases the script is called Urllib2 this module, you can see my previous document, Python URLLIB2 module

Zabbix sending text messages through scripts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.