[mrtg] Re: running mrtg against multiple devices from one .cfg fi le

Bryan Bond bbond at turnstone.com
Wed Nov 29 07:00:30 MET 2000


Here is one that I can answer! (finally)

I see two ways of doing this:

1) To keep my config files easy to manage and read, I have one config file
for each type of information I am graphing. (one for router traffic, one for
printer usage, one for ping rates, etc.) Then I have a .cmd file that is
called by the 3.bat. Since that batch file is always called every 5 minutes,
I never have to change the scheduled file to run, I just change the .cmd
file. The .cmd file itself has one line for each .cfg file. Because it is a
batch file it runs each command until it is finished before starting the
next. This makes all 6 of my instances of MRTG run in sequence. (It takes
about 45 seconds on my MRTG machine to process about 80 target OID's)

Now for number 2) Just place all of your config lines into one cfg file.
This is a very complicated and messy thing for the beginning user and it
makes it very difficult to sort out the info on separate pages. I know this
sounds simpler at first but, (I hope I am not alone here) it really is not
the best way to do it.

Now as far as getting multiple targets from one .cfg, that is easy. You can
access as many actual IP target as you want in one .cfg file.

I have included a small snippet of one of my .cfg's that include multiple
target IP's.

By using many .cfg files, I can utilize indexmaker to make index files for
each type of stat I am running. I have one page set up to be the starting
point for my staff and exec's to look at. From there they can select the
type of info they want and get an overview of each target and then drill
down to the more in depth history. (yeah, indexmaker!!)
I also have set up one page that has an include statement for every
indexmaker page I have so you can scroll down and se the daily totals on
every target I have sorted by type. It is kind of cool to show off at
meetings and to vendors who are trying to spoof you.

Any way here are my snippets: (also, .cfg files can be sent to mrtg at ogyf.org
for posting on the website  http://mrtg.turnstone.net/
(no one has sent me one since the 13th of this month.)

I am working on getting all of my .cfg files posted this week.

This config monitors CPU usage on 3 different routers:
####################################################
WorkDir: e:\inetpub\wwwroot\cpu
LogDir: e:\inetpub\wwwroot\cpu\log
HtmlDir: e:\inetpub\wwwroot\cpu
ImageDir: e:\inetpub\wwwroot\images

Target[verio-cisco-cpu]:
1.3.6.1.4.1.9.2.1.58.0&1.3.6.1.4.1.9.2.1.58.0:public at 10.10.7.1
MaxBytes[verio-cisco-cpu]: 100
Options[verio-cisco-cpu]: growright, gauge
YLegend[verio-cisco-cpu]: %
ShortLegend[verio-cisco-cpu]: %
LegendI[verio-cisco-cpu]: CPU
LegendO[verio-cisco-cpu]: CPU
Legend1[verio-cisco-cpu]: % CPU
Legend2[verio-cisco-cpu]: % CPU
Title[verio-cisco-cpu]: cpubaco
PageTop[verio-cisco-cpu]: <H1>verio-cisco % CPU load </H1>

#############################

Target[TS-A-Plus-cpu]:
1.3.6.1.4.1.9.2.1.58.0&1.3.6.1.4.1.9.2.1.58.0:public at 10.10.102.1
MaxBytes[TS-A-Plus-cpu]: 100
Options[TS-A-Plus-cpu]: growright, gauge
YLegend[TS-A-Plus-cpu]: %
ShortLegend[TS-A-Plus-cpu]: %
LegendI[TS-A-Plus-cpu]: CPU
LegendO[TS-A-Plus-cpu]: CPU
Legend1[TS-A-Plus-cpu]: % CPU
Legend2[TS-A-Plus-cpu]: % CPU
Title[TS-A-Plus-cpu]: cpubaco
PageTop[TS-A-Plus-cpu]: <H1>TS-A-Plus % CPU load </H1>

####################################3

Target[A-Plus-TS-cpu-cpu]:
1.3.6.1.4.1.9.2.1.58.0&1.3.6.1.4.1.9.2.1.58.0:public at 10.10.102.2
MaxBytes[A-Plus-TS-cpu-cpu]: 100
Options[A-Plus-TS-cpu-cpu]: growright, gauge
YLegend[A-Plus-TS-cpu-cpu]: %
ShortLegend[A-Plus-TS-cpu-cpu]: %
LegendI[A-Plus-TS-cpu-cpu]: CPU
LegendO[A-Plus-TS-cpu-cpu]: CPU
Legend1[A-Plus-TS-cpu-cpu]: % CPU
Legend2[A-Plus-TS-cpu-cpu]: % CPU
Title[A-Plus-TS-cpu-cpu]: cpubaco
PageTop[A-Plus-TS-cpu-cpu]: <H1>A-Plus-TS- % CPU load </H1>

This is the first few lines of my mrtg.cmd file:

@echo off
c:\perl\bin\perl c:\mrtg\mrtg\mrtg c:\mrtg\mrtg\mrtg.cfg
c:\perl\bin\perl c:\mrtg\mrtg\mrtg c:\mrtg\mrtg\printers\printers.cfg
c:\perl\bin\perl c:\mrtg\mrtg\mrtg c:\mrtg\mrtg\cpu.cfg
c:\perl\bin\perl c:\mrtg\mrtg\mrtg c:\mrtg\mrtg\exchange.cfg

exit (be sure to include this so the dos box goes away after it completes)


Hope this helps...

Bryan Bond
Turnstone Systems, Inc.

-----Original Message-----
From: MALCOLM DOWN -1851 [mailto:down.malcolm at abc.net.au]
Sent: Tuesday, November 28, 2000 7:54 PM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] running mrtg against multiple devices from one .cfg file



Hi I'm quite new to MRTG and have been learning more each day.

I would like to run a single instance of MRTG to monitor ports on multiple
devices on our network. At the moment I'm doing this by running multiple
instances of MRTG, each against its own .cfg file.

Is there any way of getting a single .cfg file to call multiple .cfg files
for
the actual devices?

I vaguely remember something about an 'include' function but can't find any
doc's on it.

Any help would be greatly appreciated.

TIA

Mal Down
Network Engineer
Information Technology Services
Australian Broadcasting Corporation Pty Ltd

Email:   down.malcolm at abc.net.au
Tel:     (02) 9333 1851
Mobile:  0401 584 826


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list