[mrtg] R: Re: daemon or cronjob?

Francesco Duranti fduranti at Q8.it
Wed Feb 28 14:44:33 MET 2001


you can simply make a mrtg.cfg file to use only with mrtg (not routers.cgi)
that does:

LogFormat: rrdtool
PathAdd: </path/to/rrdtool/binary/>		# in my case
/usr/local/rrdtool-1.0.28/bin
LibAdd: </path/to/rrdtool/perl/library/>	# in my case
/usr/local/rrdtool-1.0.28/lib/perl
RunAsDaemon: Yes
Forks: 2
...
other common configuration
...
include: router1.cfg
include: router2.cfg
include: routern.cfg

where router1.cfg -- routern.cfg are your router file.
In each on them you've to put the line:
LogFormat: rrdtool
to make routers.cgi work.

then you can run mrtg calling 
mrtg mrtg.cfg

and it will work without a problem.
Your routers.cgi will continue to use the single-router configuration 
and don't need to know of mrtg.cfg

Francesco

-----Messaggio originale-----
Da: Garry W. Cook [mailto:garry at cookbros.net]
Inviato: martedì 27 febbraio 2001 17.22
A: MRTG (E-mail)
Oggetto: [mrtg] Re: daemon or cronjob?



You'll find a link to the routers.cgi homepage in MRTG's 'contrib/'
directory. It's an easy to setup cgi script that creates detailed graphs and
web pages for MRTG. However, there are a few conditions that must exist in
order to use it.

MRTG must be using rrdtool to store its data, not log files. No problem,
I've added the following lines to my <MRTG>.cfg files:

LogFormat: rrdtool
PathAdd: </path/to/rrdtool/binary/>		# in my case
/usr/local/rrdtool-1.0.28/bin
LibAdd: </path/to/rrdtool/perl/library/>	# in my case
/usr/local/rrdtool-1.0.28/lib/perl

The next time MRTG is run, it converts my old .log files to .rrd files and
it will use the .rrd files from this point forward.

Next condition, you have to be running a separate .cfg file for each router.
This is where I run into trouble, because my network consists of about 75
routers. By adding the following to my <MRTG>.cfg files...

RunAsDaemon: Yes
Forks: 2

...I thought that I would be saving resources, as the .cfg files only have
to be parsed once and MRTG should fork itself into two instances instead of
one to get the job done faster.
Now it is using all 128MB of RAM on the box and most of the 256K swap file
as well.

So, what is my solution? Should I make my swap partition larger? Go back to
running MRTG as a cron job at 5 minute intervals? Before I only had it
running 5 instances from cron, each instance polling a number of routers
from one .cfg. To continue using routers.cgi, I'd now have to run 75 cron
jobs every five minutes. I'm not sure that this will be any less resource
intensive.

Anyone have any suggestions???

TIA

Garry W. Cook
gcook at summitnetworking.com

-----Original Message-----
From: dbrett at titan.golden.net [mailto:dbrett at titan.golden.net]On Behalf
Of david brett
Sent: Tuesday, February 27, 2001 8:19 AM
To: Garry W. Cook
Subject: Re: [mrtg] daemon or cronjob?


Hi Garry

Dumb question, what does router.cgi do and what application is it part of

"Garry W. Cook" wrote:

> At the risk of starting a holy war, I'm going to ask for opinions on how I
> should run MRTG - from cron or as a daemon?
> First off, some information about my project.
> I'm using MRTG to graph ATM pvc traffic on about 75 Cisco routers, split
up
> into 5 regions. The core region contains 4 Cisco 3660s and the other 4
> regions poll 10-20 Cisco 2500-2600s per region. I originally setup MRTG to
> run from the crontab on a PIII 700Mhz box running RH 7.0. Not only is this
> quite taxing on the box, but I've found that the routers.cgi frontend
> organizes everything into a very nice display. So, I've started converting
> MRTG to run using rrdtool instead of log files with the intention of using
> routers.cgi.
>
> Here are the questions that I have:
> Which is more resource intensive, daemon or crontab? I've seen posts that
> say both are best.
> Should I fork MRTG into several processes? I've read that this does not
work
> in cron, only daemon mode.
> Where can I find good information on writing startup and kill scripts for
> the MRTG daemon?
>
> Thanks in advance for any assistance.
>
> Garry W. Cook
> gcook at summitnetworking.com
>
> --
> 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

--

david





--
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