Do a lot of things

This commit is contained in:
Grégory Soutadé
2014-11-26 16:17:16 +01:00
parent 6505ca3ee5
commit 81b3eee552
12 changed files with 333 additions and 48 deletions

View File

@@ -20,6 +20,7 @@ class IWLAPostAnalysisReverseDNS(IPlugin):
try:
name, _, _ = socket.gethostbyaddr(k)
hit['remote_addr'] = name
hit['dns_name_replaced'] = True
except:
pass
finally:

View File

@@ -9,7 +9,7 @@ class IWLAPostAnalysisTopVisitors(IPlugin):
def hook(self, iwla):
hits = iwla.getValidVisitors()
stats = iwla.getMonthStats()
top_bandwidth = [(k,hits[k]['bandwidth']) for (k,v) in hits.items()]
top_bandwidth = [(k,hits[k]['bandwidth']) for k in hits.keys()]
top_bandwidth = sorted(top_bandwidth, key=lambda t: t[1], reverse=True)
stats['top_visitors'] = [hits[h[0]] for h in top_bandwidth[:10]]