On vire ce qui semble foirer
darcs-hash:20051211091901-6d78a-2d3a9548a4564891a0caf89b306219c1811aebcd.gz
This commit is contained in:
parent
c8d32f8913
commit
74cebe04de
1 changed files with 20 additions and 4 deletions
|
@ -45,6 +45,7 @@ def machine_online(machine) :
|
|||
# création d'une chaine qui ressemble à : (ip_src<<=inet('138.231.136.0/21') or ip_src<<=inet('138.231.148.0/22'))
|
||||
ip_src_in_crans = '(%s)' % ' or '.join([ "ip_src<<=inet('%s')" % net for net in NETs['all'] ])
|
||||
|
||||
|
||||
# Connections :
|
||||
###############
|
||||
|
||||
|
@ -135,10 +136,25 @@ for IP, elupload in uploadeurs:
|
|||
|
||||
# On sanctionne
|
||||
###############
|
||||
nb_decos = len([ x for x in e.blacklist() if mktime(strptime(x.split(',')[0],'%d/%m/%Y %H:%M')) > mktime(localtime())-30*24*60*60 and x.split(',')[2]=='autodisc' ])
|
||||
if nbdec >= 2:
|
||||
pass
|
||||
|
||||
# nb_decos = len([ x for x in e.blacklist() if mktime(strptime(x.split(',')[0],'%d/%m/%Y %H:%M')) > mktime(localtime())-30*24*60*60 and x.split(',')[2]=='autodisc' ])
|
||||
# if nbdec >= 2:
|
||||
# pass
|
||||
#bl=proprio.blacklist()
|
||||
#for x in bl:
|
||||
# if mktime(strptime(x.split(',')[0],'%d/%m/%Y %H:%M')) > mktime(localtime())-30*24*60*60 and x.split(',')[2]=='autodisc' :
|
||||
# liste+=x
|
||||
# message="""From: %(From)s
|
||||
# To: %(To)s
|
||||
# Subject: Upload Massif
|
||||
#
|
||||
# La machine a dépassé trois fois les limites d'upload durant le dernier mois :
|
||||
# %(liste)s
|
||||
# --
|
||||
# deconnexion.py
|
||||
# """
|
||||
# corps = message %{'From':upload.expediteur,
|
||||
# 'To':upload.expediteur,
|
||||
# 'liste':liste}
|
||||
debut = localtime(time())
|
||||
fin = localtime(time()+60*60*24)
|
||||
proprio.blacklist(["%d/%d/%d %d:%d" % (debut[2],debut[1],debut[0],debut[3],debut[4]),"%d/%d/%d %d:%d" % (fin[2],fin[1],fin[0],fin[3],fin[4]),'autodisc',"Déconn auto. %s Mo" % elupload])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue