I am curently building a script to do some tracert to verify if our web hits goes by the 10MB link and not our T1...
To do so I have devided to use tracert this way :
So my problem is that tracert need to be run as root and if I try to add this script in another user crontab file, the script does not run...> /usr/local/nagios/var/tracert.log
date >> /usr/local/nagios/var/tracert.log
sudo /usr/sbin/traceroute EXTERNAL_IP >> /usr/local/nagios/var/tracert.log
var=`egrep EXTERNAL_IP.xx? /usr/local/nagios/var/tracert.log | cut -d" " -f4 | cut -d"." -f4`
if [[( $var = 11 )]]
mail -s 'We are using the 10 MB link everything is ok' email@example.com < /usr/local/nagios/var/route_ok.msg
if [[( $var = 12 )]]
mail -s 'Crap ! the 10 MB Link is Down... RUN !' firstname.lastname@example.org < /usr/local/nagios/var/route_bad.msg
What should I do ?
P.S: Replace the term EXTERNAL_IP by a IP address...