标签:usr import art echo com rest .com system start
监控nis服务的python监控:#!/usr/bin/python
import os
ret = os.popen(‘netstat -ntpl | grep ypbind‘).readlines()
if len(ret) == 0:
os.system(‘echo "hostname
ypbind service is down" | /usr/bin/mail -s "hostname
ypbind service is down" zhi.yang@ming.com‘)
os.system(‘service ypbind restart‘)
:wq
标签:usr import art echo com rest .com system start
原文地址:http://blog.51cto.com/yangzhiming/2129780