Install MRTG on Windows. (Also available for IP Sharing/Router with SNMP)

This topic has been discussed many times everywhere.
Someone may even provide better or more detail description.
However, I would like to provide a simple, fast version for the installation.

Here is my MRTG
(This is the Linksys WRT54GX4 Wireless Router)

Section 1. Environment Requirement
1. ActivePerl (New is better)
2. Config Environment Variables, Add Perl into the “Path”
3. Install SNMP service. (PS, if you want to show the statistics of the IP Sharing, wireless/wired router, then the router must provide the SNMP service)

Section 2. Configuration
1. Go to Service console, locate SNMP.
2. Go to properties
3. Go to Security tag
4. Set community as public (if you like, you can type any string as password)
If this is the router, you may need to config the SNMP-trap IP to the server which runs the MRTG. Also, you still need to provide the community string at “Get Community” (Linksys) or just “community” (Netgear) field.

Section 3. MRTG Installation
1. Download the latest MRTG version (New is better), unzip to C:mrtg (or any path you like)
2. Open command line window, change directory/path to C:mrtgbin, run the following command:

3. perl cfgmaker public@192.168.1.x –global “WorkDir: C:any folder you like” –output mrtg.cfg
(The public password string must be the same with the “community string”)
(The “…@IP address” should be your local computer IP address, you can type ipconfig -all to check. If you are going to run the router statistics, type the router’s IP, such as

4. perl mrtg mrtg.cfg (3 times)
(3 times means)
perl mrtg mrtg.cfg
perl mrtg mrtg.cfg
perl mrtg mrtg.cfg
(You may see some warning, don’t bother. )

5. perl indexmaker mrtg.cfg –addhead=”<base target=”_blank”>” –columns=2 –width=475 –bodyopt=bgcolor=”#FFFFFF” –enumerate –title=”My MRTG” > C:any folder you like
(The output folder path C:any folder you like needs to be the same in the first and third command. If you have web server, you can view the statistics online.)

Section 4. Run as Daemon/Service
1. MRTG needs to be updated in every x minutes, which you can choose the time interval by yourself.
2. I use crontab as my solution to keep the MRTG updates. The reason is simple. MRTG needs run the command:
perl mrtg mrtg.cfg
every x minutes, so I install crontab as one service to run the command.
You may write the command in a xxx.bat (xxx is just an example file name) file, then write
* * * * * xxx.bat
in the crontab under C:windowssystem32. Also, you need to put the xxx.bat in this directory.

You can also download my config files @ Utopia Archieve


Here I provide some websites which is relevant to this topic and may even more specific in detail.
(Highly Recommand!!)(Because the site admin is my friend:)

(This one is perfect, I just found after my post.)

(This is fine, a little complex in the later part)

(A well-known guy, his blog is also good.)

(This is my first reading, I should say I don’t get the help from this article:(

(Honestly, this one is best:P)
Referenced image after installation.


One thought on “Install MRTG on Windows. (Also available for IP Sharing/Router with SNMP)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s