列表 2. 用于远程计算机的 Python 脚本

#!/usr/bin/python2

import os

Web_Log = "/var/log/httpd/access_log"

if os.path.isfile(Web_Log): 
  print "GOOD:" + Web_Log + ":GOOD"
else: 
  print "ERROR: couldn't find file."

© . All rights reserved.