MRTG can also evaluate values from external scripts such as the “mrtg-ping-probe” program which returns the round-trip time from the initiated ping command to the specified destination host. With an additional GraphStyle called “range” from Routers2, these ping times can be displayed in the monitoring system. This graph style shows the “min” and “max” RTT in one vertical line instead of two independent lines.
Since there is not much to say about this process, I will only paste my MRTG/Routers2 config for mrtg-ping-probe and will show a few example graphs here.
If not already done, mrtg-ping-probe must be installed on the monitoring system. For Debian/Ubuntu its: sudo apt-get install mrtg-ping-probe .
Following is my configuration part for the ping probes to a fictitious host of “220.127.116.11”. You need to change the “foobar” description to the hostname of the monitored machine and the “18.104.22.168” to the real IPv4 address:
#Since mrtg-ping-probe outputs integers, the values are multiplied to have milliseconds reported
#i.e., instead of "5" the answer is now "5324" which is interpreted by "Factor: 0.001" as 5.324 ms
Target[foobar_ping]: `mrtg-ping-probe -p '1000*max/1000*min' -s 22.214.171.124`
Title[foobar_ping]: Ping Times to 126.96.36.199
#MaxBytes: 10 seconds = 10 * 1000 * 1000 (due to mrtg-ping-probe * 1000 and milliseconds * 1000)
Colours[foobar_ping]: RED#FF0000, WHATEVER#123456, DARKRED#800000, WHATEVER2#654321
routers.cgi*ShortDesc[foobar_ping]: Ping 188.8.131.52
routers.cgi*Options[foobar_ping]: fixunit nomax nopercentile nototal
With this configuration I am pinging all my remote routers/firewalls on the untrust (Internet) interface as well as on the trust (through VPN) interface. This immediately gives knowledge about problems due to network congestion, overloaded devices, routing changes, etc.
Here are two graphs from my monitoring system that show the round-trip times to one of my external locations. The first one is the daily graph while the second one is the weekly graph. It is notable that the RTTs are much lower and continuous through the night while peaking several times through the working day. The weekly graph shows some major steps in the RTTs that reveal different routing paths through the Internet.