Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using MRTG + RRDtool to monitor the bandwidth on each switchport of a Cisco Catalyst 2950 via snmp. Is MRTG capable of generating an hourly graph? With RRDtool I was able to set the interval to 1 minute in hopes of getting a more detailed graph, but the shortest timeframe the graph is 'Daily' graph (5 Minute Average) and the image is too small.

What I am looking to get out of this: I am looking to be able to visually monitor all of the switch ports and tell when port begins to have unusually high traffic, in real time (1 minute interval of snmp poll, graphs generated, and page refreshed).

share|improve this question
Are you determined to go with MRTG+RRDTool? Would you consider switching to Cacti? – Mark Turner Jan 30 '11 at 22:57
I am determined to use MRTG and RRDtool, I tried Cacti and it is not what I'm looking for. – SuperMicro321 Jan 30 '11 at 23:23
Are you asking for an interface that will bring your attention to graphs with interesting values? Or are you looking for a way to configure MRTG+RRDtool to collect in 1 minute intervals? – RobW Feb 1 '11 at 2:48
I am looking for a way to configure MRTG + RRDtool to collect in 1 minute intervals. – SuperMicro321 Feb 2 '11 at 23:32

You can use the rrdgraph command line tool to generate graphs using the rrd files that MRTG generates. You can inspect he rrd file and see how soon it is consolidating the data, if it does this only after a day then you will loose the resolution that you are after. So basically I would for where MRTG stores the rra templates and the rrd graph templates.

It might take you a little time but since RRD is the backend graphing library/toolset for MRTG, Cacti, Munin, etc it is worth learning. I blogged about some things you might want to do when creating your own graphs on the Server Fault blog here.

Hopefully someone more familiar with MRTG can give you more details on your specific issue with MRTG.

share|improve this answer
The issue with this is that MRTG will not gather (via snmp) and populate the data in intervals shorter than 5 minutes. – SuperMicro321 Feb 2 '11 at 23:33
  1. Modify MRTG to use RRDtool by adding or changing the LogFormat line in your mrtg.cfg and defining the paths if necessary. Decrease your interval to 1 minute.

    LogFormat: rrdtool
    Interval: 1
    PathAdd: /path/to/rrdtool/bin/
    LibAdd: /path/to/rrdtool/lib/perl/
  2. Change your cron job to run every minute. (Edit as necessary.)

    vim /etc/cron.d/mrtg
  3. Change your index to one of the suggested Perl CGI scripts. This will generate the images on demand, rather than every time the cron job runs. I used the One4All script referenced in the link above and this is how it was modified:

    After my %graphparams = ( insert the new graph 'hourly' => ['-10h', 'now', 60],


    # the header lines and tags for the graphics
    my $pngdir = getdirwriteable($cfg->{config}{imagedir}, $cfg->{targets}{directory}{$log});

    Add a section for the new hourly graph defined previously.

    if ($sup !~ /h/) {
            print $q->h2("'Hourly' graph (1 Minute Average)"),"\n",
                    $q->img({src => "$url=hourly", alt => "hourly-graph",
                    ), "\n";
  4. Modified the Apache configuration to execute the CGI script. (/etc/httpd/conf.d/mrtg.conf)

    Outside of the tag add;

    AddHandler cgi-script .cgi

    Inside of the tag add;

    Options +ExecCGI
  5. Restart Apache and browse to your new MRTG index page.

share|improve this answer

If you use the Routers2 frontend for MRTG/RRD, then it comes with the ability to make a 4hour graph, if you are collecting data at 1min intervals. At standard resolution, 4h is the graph width with 1pixel per data point. You can enable this in the routers2.conf file.

share|improve this answer

After some modifying, the following patches worked for me:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.