service monitor
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
export DISPLAY=:0.0
servicepid=`ps aux | grep -i $1 | grep -v grep | awk '{print $2}' `
servicename=`ps aux | grep -i $1 | grep -v grep | awk '{print $11}' `
if [ "$servicepid" = "" ]; then
echo process not running
#/root/calltxtfile.sh
else
echo "$servicename running on date $(date)">>/root/log.log
fi
running the script
./servicemonitor.sh asterisk
0 comentarios:
Publicar un comentario
Suscribirse a Enviar comentarios [Atom]
<< Inicio