#!/usr/bin/python # coding: utf-8 """ Author: Jiezhi.G@gmail.com Function: Monitor server and send mail when server down! Date: 2016-03-18 PS: You can add this msg to cron: * 9,21 * * * python ~/monitor.py >> ~/monitor.log """
import urllib2 import smtplib import time from email.mime.text import MIMEText from email.header import Header