[Mac_prises] J'ai modifié le wrapper pour recevoir les mails
This commit is contained in:
parent
df49d0b6dc
commit
a95b3a1b9d
1 changed files with 18 additions and 0 deletions
|
@ -1,9 +1,27 @@
|
|||
#!/bin/sh
|
||||
|
||||
SCRIPT=/usr/scripts/surveillance/mac_prises/mac_prise_holder.py
|
||||
ANALYZER=/usr/scripts/surveillance/mac_prises/mac_prise_analyzer.py
|
||||
|
||||
# Récupération de la liste des switchs
|
||||
SWITCHS=$(/usr/bin/host -l adm.crans.org sable.adm.crans.org | /usr/bin/awk '/^bat[abcghijpm]-/{print $1}')
|
||||
|
||||
# Lancement du listage des macs en parallèle
|
||||
python $SCRIPT $SWITCHS
|
||||
|
||||
CORPS=$(python $ANALYZER)
|
||||
LENGTH=$(echo $CORPS | wc -l)
|
||||
if [ $LENGTH -ge 2 ]; then
|
||||
(
|
||||
cat <<EOF
|
||||
To: test@lists.crans.org
|
||||
From: Spoofing watcher <spoof-watcher@crans.org>
|
||||
Subject: Analyse du spoofing
|
||||
Content-Type: text/plain; charset="UTF-8"
|
||||
|
||||
${CORPS}
|
||||
--
|
||||
Script d'analyse en test
|
||||
EOF
|
||||
) | /usr/sbin/sendmail -t
|
||||
fi;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue