Run MTR (traceroute) every minute

Run MTR (traceroute) every minute

From time to time I’m experiencing Connection timed out errors in cPanel > Sent Summary and I need a way to run MTR at that exact time to troubleshoot the network problem.

chrome tKzt6IGhXQ - Run MTR (traceroute) every minute

For this I can create a new script, mtr.sh:

/usr/sbin/mtr -r -c 2 domain.com >> /root/mtr.log
  • -r option puts mtr in report mode
  • -c option prints statistics and exit

and set cron to run it every minute

* * * * * sh /root/mtr.sh

so the next time that error occurs I simply grep the mtr.log file for that time.

Another, more complicated solution involves using a python script that is called by smokeping – running only when the problem occurs.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.