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 .
MRTG/Routers2 Config
Following is my configuration part for the ping probes to a fictitious host of “1.2.3.4”. You need to change the “foobar” description to the hostname of the monitored machine and the “1.2.3.4” to the real IPv4 address:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#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 1.2.3.4` Title[foobar_ping]: Ping Times to 1.2.3.4 #MaxBytes: 10 seconds = 10 * 1000 * 1000 (due to mrtg-ping-probe * 1000 and milliseconds * 1000) MaxBytes[foobar_ping]: 10000000 Options[foobar_ping]: gauge Factor[foobar_ping]: 0.001 Colours[foobar_ping]: RED#FF0000, WHATEVER#123456, DARKRED#800000, WHATEVER2#654321 routers.cgi*ShortDesc[foobar_ping]: Ping 1.2.3.4 routers.cgi*Options[foobar_ping]: fixunit nomax nopercentile nototal routers.cgi*GraphStyle[foobar_ping]: range routers.cgi*Icon[foobar_ping]: clock-sm.gif |
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.
Sample Screenshots
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.
In which directory is the config file to be found?
Hey Ernst.
Please have a look at this blogpost which describes the installation of MRTG/RRDtool/routers2 at all: https://weberblog.net/mrtg-with-rrdtool-and-routers2-installation-from-scratch/
–> In my installations the config files are stored under /etc/mrtg/