Zabbix sending text messages via scripts

Source: Internet
Author: User

Zabbix Sending SMS principles via scripting

and Zabbix email is the same, they are the action internal configuration, the Division API to complete. Of course, there are many on the Internet using 139 of mailboxes 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 the operational permissions.
    2. Administration-> Medis types inside create. Type select Script. Fill in the name of your script.
    3. Specify Alertscriptspath in the configuration file for the server.

      Note that this folder can be visited 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 very many cases, the script calls the Urllib2 module, which is able to see my previous documents. Python urllib2 module

Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

Zabbix sending text messages via 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.