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,

/usr/sbin/mtr -r -c 2 >> /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/

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.

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.