首页 > 代码库 > url监控

url监控

#!/usr/bin/env python
#coding:utf-8

import MySQLdb,requests
import time
from datetime import datetime

global sendtime
global flag
global monitor_time


number = 0
to_email = []
params = {}
timedic = {}
a=[]
b=[]
c=[]

def sendmail(mail_list, message):
    url = "http://api.sendcloud.net/apiv2/mail/send"
    for number in range(len(mail_list)):
        params[‘apiUser‘] = ""
        params[‘apiKey‘] = ""
        params[‘from‘] = ""
        params[‘fromName‘] = "bill"
        params[‘subject‘] = "warning"
        params[‘html‘] = "your html is abnormal: " + message
        params[‘to‘] = mail_list[number]
        r = requests.post(url, files={}, data=http://www.mamicode.com/params)>

  

url监控