Part 69: Traceroute monitoring in my Zabbix global availability checks

Cover image

As a continuation to my previous global blog HTTP response time monitoring, let's continue with tracerouting. Apart from extremely small modification, for this feature, I cannot take the credit, but it belongs to this guy. It's time to add some fancy mtr data to Zabbix! For those who do not know, mtr is an enhanced version of the traditional traceroute command, showing you the network hops from your machine to some destination.

Add the template to Zabbix

Taking the instructions directly from the template author: 

  1. Copy the script file to the ExternalScripts folder on your Zabbix Server or Proxy.
  2. Make the script executable: chmod +x
  3. Import the Template by IP or Template by DNS to your Zabbix Server.

Well, that was easy. But, as I did setup my global monitoring with five Zabbix agents hanging around, I needed to do extremely small modification to the script. 

Instead of the original

MTR=$(which mtr)
$MTR -r -c3 -w -b -p -j $IP 

... it is now

MTR=$(which mtr)
$MTR -r -c3 -w -b -p -j $IP -a $OUTBOUNDINTERFACE

With that modification, mtr uses any IP address that's configured on server for its outbound connections instead of the primary interface.

Tune the template in Zabbix

The mtr template has exactly one item and to make the above script modification to work, I needed to modify the template just a tiiny tiny bit: added the {$OUTBOUNDINTERFACE} macro there as the second parameter for and ....



... added the said macro to each of my probe hosts.

Host macro

The results

As a result, I can now see how the packets travel around the world. I hope they remember to snap some photos of the virtual destinations they travel to...



Closer example from Australia


Actually following the traceroute in time series format can be very useful, as you can visually see the exact spot when something changed, and then compare what was the change.

Using Grafana's Zabbix plugin, you can then for example see the individual hops and their state over time in a bit different format. I'm sure that this template has it uses in the actual business monitoring, too. Next time, we'll take a look at DNS monitoring.


Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Buy me a coffee

Like these posts? Support the project and Buy me a coffee