From 94f8855b9a54aff4aee0f4f7d34bfc5f638c7379 Mon Sep 17 00:00:00 2001 From: pessoles Date: Sat, 1 Oct 2005 13:19:44 +0200 Subject: [PATCH] migration de la base sur rouge darcs-hash:20051001111944-6d78a-5a3f0ad35992b3f436066992109a288e52627b4c.gz --- surveillance/filtrage_firewall.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/surveillance/filtrage_firewall.py b/surveillance/filtrage_firewall.py index fff9e0e8..eb16eb2f 100755 --- a/surveillance/filtrage_firewall.py +++ b/surveillance/filtrage_firewall.py @@ -15,7 +15,7 @@ import iptools from pyPgSQL import PgSQL import re from time import gmtime,strftime -sys.path.append('/home/bernat') +sys.path.append('/usr/script/surveillance') import strptime # Définition de constantes : @@ -24,7 +24,7 @@ reseau = ["138.231.136.0/21", "138.231.148.0/22"] # Ouverture de la base de données : ################################### -pgsql = PgSQL.connect(host='/var/run/postgresql', database='filtrage', user='crans') +pgsql = PgSQL.connect(host='/var/run/postgresql', database='filtrage', user='crans',host='rouge.adm.crans.org') pgsql.autocommit = True @@ -81,7 +81,7 @@ for log in filtre : if resultat_p2p : ip_src = resultat_p2p.group(3) - verif = iptools.AddrInNets (actuel["ip_src"],reseau) + verif = iptools.AddrInNets (ip_src,reseau) if verif : date = resultat_p2p.group(1) id_p2p = int(protocole_p2p[resultat_p2p.group(2)]) @@ -101,8 +101,8 @@ for log in filtre : # On teste si le log contient des virus ######################################## elif resultat_virus : - ip_src = resultat_p2p.group(3) - verif = iptools.AddrInNets (actuel["ip_src"],reseau) + ip_src = resultat_virus.group(3) + verif = iptools.AddrInNets (ip_src,reseau) if verif : date = resultat_virus.group(1) ip_src = resultat_virus.group(3) @@ -119,8 +119,8 @@ for log in filtre : elif resultat_flood : - ip_src = resultat_p2p.group(3) - verif = iptools.AddrInNets (actuel["ip_src"],reseau) + ip_src = resultat_flood.group(3) + verif = iptools.AddrInNets (ip_src,reseau) if verif : date = resultat_flood.group(1) ip_src = resultat_flood.group(3)