使用python监控进程

eg. 监控nginx # !/usr/bin/env python import os, sys, time while True: time.sleep(3) try: ret = os.popen('ps -C nginx -o pid »