Lukas Beran
Lukas Beran

Welcome to my blog! If you're looking for tutorials, hints or tips for IT, you're right here. You will find mostly articles on Microsoft products and technologies - operating systems, servers, virtualization, networks, management, but also the cloud. Sometimes I add some other interesting things.

September 2014


Data traffic measurement

Lukas BeranLukas Beran

On servers you often need to measure and visualize data traffic. In today’s article I will show you a guide how to use MRTG on Windows Server 2012 R2.


Download and extract MRTG from

For running the tool you need Perl. Recommended is ActivePerl. Perl has to be in system PATH, which is a default setiing when installing ActivePerl. I described how to change system PATH in an older article. If you want to verify that Perl works properly, open command prompt and change the location to c:\mrtg-2.17.4\bin (or where you extracted MRTG) and run

You also need an IP address or a hostname of the machine you want to monitor, and read-only SNMP community string.

You also need running SNMP Service. This service is a part of SNMP features in Windows Server 2012 R2 so you need to install SNMP using Add roles and features. In Services (services.msc) open the service and on the tab Security add Community name with read-only rights and restart the service.

Configure MRTG

Open command prompt and change your location to extracted MRTG folder (for example c:\mrtg-2.17.4\bin).

First you need to generate configuration file:

Now you have a configuration file. If any error occurs, your SNMP service is probably not running properly or your device is not available.

Now open your configuration file mrtg.cfg, where you can see all interfaces of your device. Here you can remove interfaces which you don’t want to monitor.

Now we can generate HTML files using perl mrtg mrtg.cfg. It’s OK if you see errors. You need to run this command three times, then it should be with no error. Now the configuration is done. Every time you run the command, you regenerate the graphs.

Running MRTG as a service

For running MRTG as a service you need two additional files – SrvAny.exe (Applications as Services Utility) and INSTSRV.exe (Service Installer). Both files are from Microsoft Resource Kit. Copy these files to MRTG/bin folder.

Now create mrtg.reg file with the following content:

Now create a new service from command line instsrv MRTG c:\mrtg-2.17.4\bin\srvany.exe and App* records for the service regedit /s mrtg.reg.

Now reports are generated every five minutes.

My primary focus is the security of identities, devices and data in the cloud using Microsoft services, technologies and tools.

Comments 0
There are currently no comments.