PATH=/usr/local/sbin:/usr/ local/bin:/sbin:/bin:/usr/ sbin:/usr/bin
export DISPLAY=:0.0
A=`asterisk -x " sip show peer 1018" | grep -i status | cut -d' ' -f11 `
if [ "$A" != "OK" ]; then
B=`asterisk -x "originate dahdi/g0/18097145874 extension
923@emergency" `
echo "Servidor no disponible $(date)" >> /root/lg.log
else
echo "Server up"
fi
# echo $A
[root@PBXPPCC ~]# chmod 777 /root/monitor.sh
Cron Job
[root@PBXPPCC ~]# crontab -e
*/1 * * * * /bin/date >> /root/log1.log
*/1 * * * * cd /root && /bin/bash /root/monitor.sh >> /root/test.log
*/1 * * * * cd /root/ && sh monitor.sh >> /root/tes1.log
Verificamos el Cron Job
[root@PBXPPCC ~]# crontab -l
*/1 * * * * /bin/date >> /root/log1.log
*/1 * * * * cd /root && /bin/bash /root/monitor.sh >> /root/test.log
*/1 * * * * cd /root/ && sh monitor.sh >> /root/tes1.log
Asterisk dial plan
[emergency]
exten=>s,1,Answer()
same=>n,Playback(emergency)
same=>n,Hangup()
No hay comentarios:
Publicar un comentario