Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (24 sloc) 730 Bytes
# -*- coding: utf-8 -*-
# edit /etc/crontab */1 * * * * username python /home/hoge/webapp_monitor/httpd_monitor.py
import os
import sys
import re
from subprocess import Popen,PIPE
import datetime
import urllib, urllib2, cookielib, re
import signal
import time
ROOTDIR = os.path.normpath(os.path.dirname(__file__))
execfile(ROOTDIR + "/config.py")
pid_list = []
for i in range(1,G_CONFIG['reqsan_manager']['process_num']):
command = "python reqsan.py" + " " + str(i)
proc = Popen([command],shell=True, stdout=PIPE, stderr=PIPE)
pid_list.append(proc.pid)
print i
time.sleep(G_CONFIG['reqsan_manager']['ignite_duration'])
print pid_list
time.sleep(30)
for i in pid_list:
os.kill(i,signal.SIGKILL)
print "end"