[sniffer] autoconf d'arpwatch, sur dyson, special crans

Ignore-this: 273a6d04fd110d2c14a3c5b8679977e4

darcs-hash:20120512174644-3ca67-0f23dfe04102f93276501c57d8ddc251f05f13ac.gz
This commit is contained in:
daniel.stan 2012-05-12 19:46:44 +02:00
parent 467bf7fd96
commit 216f227f67
7 changed files with 56 additions and 2 deletions

View file

@ -1,6 +1,7 @@
# -*- coding: utf-8; mode: python -*-
include("ip")
include("arpwatch")
info["owner"] = "root"
info["group"] = "root"
@ -12,10 +13,13 @@ Les modifications locales sont a mettre dans le fichier /etc/network/interfaces.
Voir http://wiki.crans.org/CransTechnique/Bcfg2/... pour plus d'explications.
""")
configured_ifaces=[]
def dev(interface, mode, additionnals=[]):
"""Generation de la conf d'une interface:
- additionnals contient des lignes a mettre en plus a la definition"""
configured_ifaces.append(interface)
if mode == "pub":
print """auto %(interface)s
@ -122,6 +126,17 @@ print """auto lo
iface lo inet loopback
"""
# Pour arpwatch, on surveille nos réseaux
def otherlisteners():
print "#Interfaces d'ecoute restantes pour arpwatch "
for vlan in watched_vlans:
if vlan == 1:
iface = 'eth0'
else:
iface = 'eth0.%d' % vlan
if not iface in configured_ifaces:
dev(iface,'vide')
def pubip6(If):
return "2a01:240:fe3d:4:" + If_Mac[If]

View file

@ -59,3 +59,7 @@ if has("users"):
@ALL ALL=(respbats) /usr/scripts/gestion/chsh.py, NOPASSWD:/usr/local/bin/ldap_whoami
@# Quotas
@ALL ALL=NOPASSWD:/usr/local/bin/quota.sh
if has('arpwatch'):
@# arpwatch
@arpwatch ALL=(arpwatch) NOPASSWD:/usr/scripts/surveillance/arpwatch_sendmail.py