MRTG logo


Multi Router Traffic Grapher (MRTG) is an excellent tool to monitor the traffic load on network-links (amongst other things). It achieves this by examining the various OID's of SNMP enabled devices that you specify to produce a range of graphs. It is written in Perl.


MRTG screenshot


MRTG can be run as a Windows service using FireDaemon Pro. This allows you to start and run the monitor automatically when Windows boots and before login. FireDaemon Pro also allows you to start multiple instances of the application, monitoring them and automatically restarting those instances in the event they crash. FireDaemon Fusion can also be used to manage your MRTG service, plus other Windows services via your web browser.


MRTG Monitor Setup Under FireDaemon Pro

Please follow the steps below to set up a MRTG monitor as a Windows service with FireDaemon Pro


Step 1: Download and Install MRTG

  1. Download the latest MRTG zip. A single ZIP file mrtg-X.Y.Z.zip is downloaded (X.Y.Z corresponds to current version number).
  2. Extract the contents of the zip to "C:\", the path to the monitor files should now be "C:\mrtg-X.Y.Z". For ease of use, rename "C:\mrtg-X.Y.Z" to "C:\MRTG".


Step 2: Download and Install Strawberry Perl

ActivePerl is the most popular windows distribution of Perl but it has problems with several packages. So for this reason we suggest to use Strawberry Perl.

  1. Download the latest Strawberry Perl x64 msi.
  2. Double click "strawberry-perl-W.X.Y.Z-64bit.msi"
    W.X.Y.Z corresponds to current version number. By default it installs to "C:\Strawberry".


Step 3: SNMP Setup

Your SNMP configuration will be dependent on the device or software you are setting up. For example, on a Sonicwall router you might configure SNMP as follows:


Sonicwall SNMP Settings


Step 4: MRTG Configuration File

The next step is to create an MRTG configuration file. Your community strings and IPs are specific to your installation. Do this as follows at a command prompt (Start->Run->cmd):

cd C:\MRTG
perl cfgmaker public@192.168.168.168 --output mysettings.cfg
Then open "C:\MRTG\bin\mysettings.cfg" add to the top:
RunAsDaemon: yes
Interval: 5
WorkDir: C:\Nginx\html

Replace 192.168.168.168 with the IP of the device sending SNMP packets (eg. router, switch, etc.). Check your WorkDir and confirm that the various HTML and PNG files have been generated and that there are no errors in the log file (mrtg.log). Alternately, you can log to the Windows EventLog by substituting "eventlog" for "mrtg.log" above.


Step 5: Download, Install and Configure Nginx

  1. Download the lastest Nginx mainline from here.
  2. Extract the contents of the zip to "C:\", the path to the monitor files should now be "C:\nginx-X.Y.Z". For ease of use, rename "C:\nginx-X.Y.Z" to "C:\Nginx".

Step 6: Download and Install FireDaemon Pro

  1. Download FireDaemon Pro installer
  2. Double-click installer and follow the installation wizard to complete the installation.
  3. For more information about installing FireDaemon, see the FireDaemon Pro Users Guide.


Step 7: Set Up Nginx as a FireDaemon Pro Service

Double click the FireDaemon Pro icon on your desktop, then click on the New (i.e. +) button in the toolbar (or type Ctrl + N) to create a new service. Enter the information into the fields as you see below. Adjust the path names to suit your installation. Note the required parameters.


FireDaemon Pro Nginx Service Program Tab


Next, click on the FireDaemon Pro Settings tab:

FireDaemon Pro Nginx service settings


Enter appropriate values in the fields on the Settings tab as follows:


  • (Required) Job Type: Set to "Global Job".
  • (Optional) Logon Account: Enter the Windows account under which the application is to be run, e.g. the current user account.
  • Password / Confirm Password:  Enter the logon account's password twice.
  • (Optional) Interact with Desktop: Keep this unchecked because Nginx does not create any window.
  • (Optional) Priority: To allocate more CPU time to the application, select a higher scheduling priority in this field.
  • (Optional) CPU Bindings: To run the application on a specific CPU, specify the appropriate CPU in this field.


Next, click in the Lifecycle tab. Set Shutdown By to Forceful Termination and check "Console Program".


FireDaemon Pro Nginx lifecycle settings


Lastly, click the Save and Close (ie. the tick) button on the toolbar. If the service's Startup Type is set to Automatic or Automatic (Delayed-Start), it will start immediately.


Step 8: Set Up MRTG as a FireDaemon Pro Service

Double click the FireDaemon Pro icon on your desktop, then click on the New (i.e. +) button in the toolbar (or type Ctrl + N) to create a new service. Enter the information into the fields as you see below. Adjust the path names to suit your installation. Note the required parameters.


FireDaemon Pro MRTG Service Program Tab


The most important field on the tab is the Parameters. The Parameters define the initial setup of your server. The full parameter list should be as follows:

mrtg --logging=mrtg.log mysettings.cfg
  • "mrtg" Loads MRTG perl script.
  • "-logging=mrtg.log" Logs to "C:\MRTG\b in\mrtg.log".
  • "mysettings.cfg" Loads the settings file you created previously.

Next, click on the FireDaemon Pro Settings tab:


FireDaemon Pro MRTG service settings


Enter appropriate values in the fields on the Settings tab as follows:

  • (Required) Job Type: Set to "Global Job".
  • (Optional) Logon Account: Enter the Windows account under which the application is to be run, e.g. the current user account.
  • Password / Confirm Password:  Enter the logon account's password twice.
  • (Optional) Interact with Desktop: If this setting is enabled (default), the application's output messages can be seen in the console window on Windows Session 0. To switch to Session 0, it may be necessary to install FireDaemon Zero and ZeroInput. Alternatively, this setting may be disabled, in which case the application's messages will be hidden.
  • (Optional) Priority: To allocate more CPU time to the application, select a higher scheduling priority in this field.
  • (Optional) CPU Bindings: To run the application on a specific CPU, specify the appropriate CPU in this field.


Next, click in the Lifecycle tab. Set Shutdown By to Forceful Termination and check "Console Program".


FireDaemon Pro MRTG lifecycle settings


Lastly, click the Save and Close (ie. the tick) button on the toolbar. If the service's Startup Type is set to Automatic or Automatic (Delayed-Start), it will start immediately.


Step 9: Verify that MRTG and Nginx are Running Correctly

MRTG and Nginx's statuses can easily be checked on the main FireDaemon Pro Services List - look for a Running Status value and a numeric Process ID (PID) value.


FireDaemon Pro Services list

If the service's Interact with Desktop setting is enabled, the MRTG status can also be verified by switching to Windows Session 0 to view MRTG's messages.


MRTG messages window