[mrtg] Re: Can mrtg just read from file instead of SNMP?

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Fri Oct 8 23:28:48 MEST 1999


Clint Alexander wrote:
[...]
> on the Target[]: section. I read this, and do
> not quite understand what to do in this scenario.
> I want to pretend that none of our routers can
> respond via snmp query, but still build the graphs.
> 
> The config.html does not quite explain how to do this in its entirety.
> Is anyone else familiar with this procedure?
> 
> Clint Alexander

>From the original messages and some of your replies to replies I think
you want to import data that was collected before. If not, no need to
continue reading this mail.

When doing things with MRTG that it was not originally designed for,
you need to know how it works.

Simplified:

- Get some data from somewhere by whatever means
- Process this data if necessary
- Feed it to "rateup" (rateup.exe on NT)
  *** it is rateup that builds the logfile ***
- Let rateup create an image of the data collected so far

If I understand you right, you want to import data that was already
collected and use MRTG to create images. I think you should be looking
at rateup.  Better yet, skip rateup and mrtg; go for rrdtool.

MRTG won't let you specify the time for each sample. It is a front-end
for rateup.

I included an example for rateup. Again: it's better to look at rrdtool
instead. Read the tutorial for it.

> Usage: rateup directory basename [sampletime] [t sampletime] \
> [-(t)ransparent] [u|a|g|h|m in out abs_max] [i/p file maxvi \
> maxvo maxx maxy growright step bits]

(this might not be the most recent rateup)

You could use rateup to build an MRTG logfile:
(g is for gauge, numbers are: timestamp, in, out, max-allowed)

Do:
   rateup . blah 939412800 g 100 200 1000
   rateup . blah 939413100 g 110 220 1000
   rateup . blah 939413400 g 120 230 1000
   rateup . blah 939413700 g 130 200 1000
   rateup . blah 939414000 g 200 100 1000
   head -6 blah.log

and get

   [alex at host /home/alex]$ rateup . blah 939412800 g 100 200 1000
   Rateup WARNING: rateup could not read the primary log file for blah
   Rateup WARNING: rateup The backup log file for blah was invalid as well
   Rateup WARNING: rateup Can't remove blah.old updating log file
   Rateup WARNING: rateup Can't rename blah.log to blah.old updating log file
   [alex at host /home/alex]$ rateup . blah 939413100 g 110 220 1000
   Rateup WARNING: rateup Can't remove blah.old updating log file
   [alex at host /home/alex]$ rateup . blah 939413400 g 120 230 1000
   [alex at host /home/alex]$ rateup . blah 939413700 g 130 200 1000
   [alex at host /home/alex]$ rateup . blah 939414000 g 200 100 1000
   [alex at host /home/alex]$ head -6 blah.log
   939414000 200 100
   939414000 200 100 200 100
   939413700 130 200 130 200
   939413400 120 230 120 230
   939413100 110 220 110 220
   939412800 0 0 0 0

Hope this helps,
Alex

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list