- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
#!/usr/bin/python
# -*- coding: utf-8 -*-
import psycopg2
from loki.libs.net.ipaddr import IPAddress
import sys
sys.path.append('../libs/')
try:
loki_db = psycopg2.connect (port="15432", host="noc2.t72.ru", database="loki_db", user="utkin", password="2UtaWEvaspuv")
loki_cur = loki_db.cursor()
except:
print "Нет коннекта к локи_дб"
try:
cherry_db = psycopg2.connect (port="5432", host="noc2.72.ru", database="cherry", user="utkin", password="2UtaWEvaspuv")
cherry_cur = cherry_db.cursor()
except:
print "Нет коннекта к черри_дб"
loki_cur.execute("""
select id, nas_id, service, ip_addr_id from inet_inetsessionactive;
""");
rows = loki_cur.fetchall()
for (id, nas_id, service, ip_addr_id) in rows:
loki_cur.execute("""select ip from inet_nasserver where id = %s;""",(nas_id,))
try:
nas_ip = loki_cur.fetchone()[0]
except:
print "Нет записи о NAS-сервере"
loki_cur.execute("""select addr from inet_ouripall where id = %s;""",(ip_addr_id,))
ip = str(IPAddress(int(loki_cur.fetchone()[0]))._ip)
cherry_cur.execute("""select client_id, water_mark from inet_dynamic_ip_services where id = %s;""", (service,))
try:
(client_id, water_mark) = cherry_cur.fetchone()
except:
print "Нет записи в таблице inet_dynamic_ip_services: id, nas_id, service = (%s, %s, %s)"%(id, nas_id, service)
cherry_cur.execute("""select balance from base_clients where client_id = %s;""",(client_id,));
try:
balance = cherry_cur.fetchone()[0]
if balance <= water_mark:
kill(ip, nas_ip)
except:
print "Нет записи в base_clients: client_id = %s"%client_id
brainstorm 13.01.2011 12:55 # −3
guest 21.01.2017 12:39 # −15
guest 04.03.2017 05:33 # −15
guest 31.03.2017 15:53 # −15
</a>
<a href=http://datingice.com/>Join your local group and meet other singles
</a>
<a href=http://rhdating.com/>Free Local Personals
</a>
<a href=http://sexdatingdelight.com/>Sex Dating Delight
</a>
http://adultdatingbrisbane.com/
http://datingice.com/
http://rhdating.com/
http://sexdatingdelight.com/
guest 14.04.2017 08:29 # −11
<a href=" http://achetercialissansordonnanceenpharmacie.c om/ ">ou acheter du cialis sans ordonnance </a>
guest 14.04.2017 08:34 # −11
<a href=" http://achatcialisenfrancelivraisonrapide.com ">acheter cialis 5mg en ligne en france </a>
guest 14.04.2017 08:51 # −11
<a href=" http://achetercialis20mgenligne.com/ ">acheter cialis 20mg original </a>
guest 14.04.2017 08:52 # −11
<a href=" http://achatcialis5mgenligne.com/ ">acheter cialis 5mg </a>
guest 15.04.2017 04:30 # −5
<a href=" http://achattadalafilenfranceenpharmacie.com/ ">acheter cialis en france sans ordonnance </a>
guest 15.04.2017 04:35 # −5
<a href=" http://acheterpropeciasurinternet.com/ ">acheter propecia sur internet </a>
guest 15.04.2017 16:55 # −5
<a href=" http://achatpropeciaparcartebancaire.com/ ">achat propecia partnership </a>
guest 15.04.2017 18:48 # −5
<a href=" http://achatamoxicillinebiogaran1g.com/ ">achat amoxicilline acide clavulanique </a>
guest 21.04.2017 08:48 # −5
<a href=" http://vardenafilprixenpharmacieacaen.com/ ">levitra prix en belgique </a>
rss 21.04.2017 23:04 # 0
Acid Beast 24.08.2021 02:10 # 0