Skip to header Skip to main navigation Skip to main content Skip to footer

Search form

Site branding

Home
What's up, home?

Main navigation

  • Home
  • Story mode
  • About
  • Features
  • Hardware list
  • Videos
  • GitHub (opens in new tab)
  • Daily AI generated stories (opens in new tab)

Part 69: Traceroute monitoring in my Zabbix global availability checks

Breadcrumbs

Breadcrumb

  • Home
  • Part 69: Traceroute monitoring in my Zabbix global availability checks

Main page content

By whatsuphome | 10:12 PM EET, Wed March 13, 2024

TL;DR

I added mtr traceroute data to my global availability checks using a community template and a small script tweak that adds an {$OUTBOUNDINTERFACE} macro. Now each of my five probe hosts runs mtr from the right interface and Zabbix shows the network hops
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 mtr.sh to the ExternalScripts folder on your Zabbix Server or Proxy.
  2. Make the script executable: chmod +x mtr.sh
  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 mtr.sh script. 

Instead of the original

#!/bin/bash
MTR=$(which mtr)
IP=$1
$MTR -r -c3 -w -b -p -j $IP 

... it is now

#!/bin/bash
MTR=$(which mtr)
IP=$1
OUTBOUNDINTERFACE=$2
$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 mtr.sh and ....

Item

 

... 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...

Traceroute

 

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.

Grafana
whatsuphome
zabbix
grafana
syntheticmonitoring
mtr
traceroute
  • Add new comment

Comments (1)

  • 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.

Grafana panel

bboy8012 (not verified)

1 year 6 months ago
Permalink
New

Just wondering if you could provide the json for the grafana panel on how you set it up abve

  • Reply
I added mtr traceroute data to my global availability checks using a community template and a small script tweak that adds an {$OUTBOUNDINTERFACE} macro. Now each of my five probe hosts runs mtr from the right interface and Zabbix shows the network hops

Search

Who am I?

  • Janne Pikkarainen from Finland 🇫🇮
  • Principal Site Reliability Engineer at Forcepoint
  • A Zabbix Summit speaker every year since 2022
  • Walking, talking Zabbix commercial

Support my project

Buy me a coffee 

Footer menu

  • Contact

What's up, home? | Janne Pikkarainen | contact(at)whatsuphome.fi | 2022 - 2026

Developed and Designed by Janne Pikkarainen