· 7 years ago · Apr 24, 2018, 02:46 PM
1diff --git a/python-sentineld.py b/python-sentineld.py
2old mode 100644
3new mode 100755
4index 26a5a6c..e4f5914
5--- a/python-sentineld.py
6+++ b/python-sentineld.py
7@@ -17,12 +17,13 @@ class MyDaemon(daemon.Daemon):
8 def run(self):
9 num_threads = 4
10 queue = Queue()
11- #ips = ["olololdddd", "google.com", "mail.ru", "yandex.ru"]
12- ips = ["mail.ru"]
13+ ips = ["olololdddd", "google.com", "mail.ru", "yandex.ru", "fuck.ru", "shit.ru"]
14+ #ips = ["mail.ru", "yandex.ru"]
15 def pinger(i, q):
16 # ping server
17 while True:
18 ip = q.get()
19+ q.put(ip)
20 print "Thread %s: Pinging %s" % (i, ip)
21 ret = subprocess.call("ping -c 5 %s" % ip,
22 shell=True,
23@@ -60,8 +61,8 @@ my_daemon = MyDaemon()
24
25 if len(sys.argv) >= 2:
26 if 'start' == sys.argv[1]:
27- my_daemon.start()
28- # my_daemon.start(interactive=True)
29+ # my_daemon.start()
30+ my_daemon.start(interactive=True)
31 elif 'stop' == sys.argv[1]:
32 my_daemon.stop()
33 elif 'restart' == sys.argv[1]: