Ajout du testZombie pour tuer les processus Zombies
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@942 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
15
check
15
check
@@ -166,7 +166,7 @@ function testdf()
|
|||||||
fi
|
fi
|
||||||
IFS="
|
IFS="
|
||||||
"
|
"
|
||||||
for ligne in `df -P -l -x tmpfs -x devtmpfs $fs | sed '/Used Available/d'`; do
|
for ligne in `df -P -l -x tmpfs -x devtmpfs $fs | sed '/Filesystem/d'`; do
|
||||||
fs_space=`echo $ligne | awk '{print $5}'| sed 's/\%//'`
|
fs_space=`echo $ligne | awk '{print $5}'| sed 's/\%//'`
|
||||||
filesys=`echo $ligne | awk '{print $6}'`
|
filesys=`echo $ligne | awk '{print $6}'`
|
||||||
if [ $fs_space -gt $limite ]; then
|
if [ $fs_space -gt $limite ]; then
|
||||||
@@ -269,6 +269,19 @@ function testNTP()
|
|||||||
/usr/bin/ntpq -n -c peers | egrep -q '^\*' || checklog "Serveur de temps désynchronisé ou injoignable"
|
/usr/bin/ntpq -n -c peers | egrep -q '^\*' || checklog "Serveur de temps désynchronisé ou injoignable"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testZombie()
|
||||||
|
{
|
||||||
|
# Cette fonction teste les zombies qui trainent sur le système. Elle les tue
|
||||||
|
for ligne in `ps -eo pid,ppid,state,cmd | grep -v grep | grep ' Z '`; do
|
||||||
|
echo "Zombie : $ligne"
|
||||||
|
IFS=" "
|
||||||
|
for proc in `echo $ligne | awk '{print $1" "$2}'`; do
|
||||||
|
echo " PROCESSUS TUE :$proc"
|
||||||
|
kill -9 $proc 2>/dev/null
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! -f "/etc/check.conf" ]; then
|
if [ ! -f "/etc/check.conf" ]; then
|
||||||
echo "Le fichier /etc/check.conf n'existe pas : EXIT"
|
echo "Le fichier /etc/check.conf n'existe pas : EXIT"
|
||||||
exit
|
exit
|
||||||
|
|||||||
@@ -66,3 +66,7 @@ alerteNotify=FALSE
|
|||||||
|
|
||||||
## Verifie si le seuil de la batterie est depasse et donc qu'il faut recharger
|
## Verifie si le seuil de la batterie est depasse et donc qu'il faut recharger
|
||||||
#testBatterie
|
#testBatterie
|
||||||
|
|
||||||
|
## Vérifie si un ou plusieurs processus zombies existent et le tuent
|
||||||
|
testZombie
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user