Design and Application of platform-based url callback for extended monitoring functions [python]

Source: Internet
Author: User

Preface:

Some third-party vendors in China are also using this service, such as dnspod url callback and monitoring treasure url callback!

Someone has opened up a script and monitored the url callback, which can be combined with the dnspod api. When the web of ip-A is dead, the dns record is switched to ip-B. Of course, this is only a small application, but it is a good idea. I have simply implemented it.

The so-called URL callback function allows you to send alarm notifications to your specified URL, allowing you to process alarm messages more flexibly.

How to use a flexible method:

In fact, every business department wants to calculate its own error, but the monitoring platform is generally in the hands of the basic monitoring department and is not easy to deploy. At this time, url callback is a good method. I will push the alarm information not only to your mail and mobile phone, but also to your url address. After your server accepts the authenticated url address, it will take appropriate measures, such as inserting it into the database, making report statistics by yourself, and performing automatic processing based on the information.

Trigger processing:

It's just a personal idea ~

Under the monitoring system, for example, nagios and zabbix professional monitoring systems. Let's talk about it in an example: When monitoring whether mysql is highly delayed or not, we usually load the monitoring script in nagios to obtain and judge the latency, the content of the script processing on a node is while get for every mysql slave, and the high-latency one is kicked out in the load group. In this case, two scripts are used.

If url callback is used, the processing script can be used. This script is executed only when url callback is triggered. This avoids endless judgment and retrieval of processing scripts. If we monitor services with high statistical pressure, it will be a little sad.

Of course, this will also cause some problems. For example, if the web is dead, he cannot accept url callback. On the other hand, the Development Department does not want to call external commands at the system level. After all, responsibility is a problem.



The following is a demo of url callback I wrote. I have the opportunity to go online for testing by the experts.


In the first version, the post method and the view of callback results were not defined.


650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/1216252340-0.jpg "title =" g1_ .jpg "alt =" 013908564.jpg"/>

In the second version, get and post methods are used to verify the returned results.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131229/121625E32-1.jpg "title =" QQ2013121601303.jpg "alt =" 014152514.jpg"/>


This article link: http://rfyiamcool.blog.51cto.com/1030776/1332160


If there is a post, it will be added ~


This article is from "Fengyun, it's her ." Blog, declined to reprint!

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.