MàJ Semaine du 17 au 23 novembre 2008

This commit is contained in:
olivier
2008-11-25 22:01:25 +01:00
parent 7fee67a77c
commit fa26da8678
23 changed files with 1016 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#!/bin/bash
## Script permettant d'avoir le top 10 des machines de chaque utilisateur
nombre_ligne=`last | wc -l`
nombre_reel=$(expr $nombre_ligne - 1 )
utilisateurs=`last | cut -d " " -f 1 | head -n $nombre_reel | sort | uniq -c | sort -r | head | tr -s " " | cut -d " " -f 3`
for i in $utilisateurs
do
echo $i
machines=`last -a $i | tr -s " " | cut -d " " -f 2 | sort | uniq -c | sort -r | head | tr -s " " | cut -d " " -f 3`
for j in $machines
do
if [ $j != "begins" ]
then
if [ $j != "" ]
then
echo -e "\t$j"
fi
fi
done
done

View File

@ -0,0 +1,24 @@
#!/bin/bash
## Script permettant d'avoir le top 10 des machines de chaque utilisateur
nombre_ligne=`last | wc -l`
nombre_reel=$(expr $nombre_ligne - 1 )
utilisateurs=`last | cut -d " " -f 1 | head -n $nombre_reel | sort | uniq -c | sort -r | head | tr -s " " | cut -d " " -f 3`
for i in $utilisateurs
do
echo $i
machines=`last -a $i | tr -s " " | cut -d " " -f 2 | sort | uniq -c | sort -r | head | tr -s " " | cut -d " " -f 3`
for j in $machines
do
# if [ $j != "wtmp" ]
# then
# if [ $j != "" ]
# then
echo -e "\t$j"
# fi
# fi
done
done

View File

@ -0,0 +1,17 @@
#!/bin/bash
## Script permettant d'avoir le top 10 des utilisateurs ayant le plus grand nombre de connexions à cette machine
echo "Traitement en cours ..."
nombre_ligne=`last | wc -l`
nombre_reel=$(expr $nombre_ligne - 1 )
utilisateurs=`last | cut -d " " -f 1 | head -n $nombre_reel | sort | uniq -c | sort -r | head | tr -s " " | cut -d " " -f 3`
for i in $utilisateurs
do
if [ $i != "reboot" ]
then
echo -e "$i"
fi
done

View File

@ -0,0 +1,17 @@
#!/bin/bash
## Script permettant d'avoir le top 10 des utilisateurs ayant le plus grand nombre de connexions à cette machine
echo "Traitement en cours ..."
nombre_ligne=`last | wc -l`
nombre_reel=$(expr $nombre_ligne - 1 )
utilisateurs=`last | cut -d " " -f 1 | head -n $nombre_reel | sort | uniq -c | sort -rn | head | tr -s " " | cut -d " " -f 3`
for i in $utilisateurs
do
if [ $i != "reboot" ]
then
echo -e "$i"
fi
done