[mrtg] Re: combining logs to provide aggregates of usage
Matthew Petach
mpetach at concentric.com
Wed Jan 12 01:35:50 MET 2000
Recently, Andrew Thompson talked about "[mrtg] combining logs to provide aggregates of usage", and said
>
> Hi
> i wonder if anyone would be able to help:
> at the moment, i use mrtg 2.5.2 on a linux box (red hat 5.2), works a
> treat. I also use the scripts from
> http://buckaroo.xo.com/MRTG/ to combine logs (combine-logs.pl) and the
> mrtg_gen_one_gif.pl to generate gifs from the resulting logs. this means I
> can get a nice graph that shows how many lines in total i've got in use on
> my as5300s. Anyway, I have built a new box (red hat 6.1) to run stats on.
> I have tried mrtg 2.5.4c and this works OK, but I can no longer use the
> combined logs to get a new gif, errors below. I tried 2.7.2 and 2.8.9 and
> various versions of rateup, still to no avail. mrtg_gen_one_gif.pl runs on
> the individual log file sand produces gifs, but not on the combined ones.
> Any ideas why this is ? I've spent 2 fruitless days and nights trying to
> get this right.aaaagghhhh !
mrtg_gen_one_gif.pl is very sensitive to which version of
rateup you use. If you change versions of rateup, you need
to ensure that the arguments being passed to rateup from the
gen_one_gif script are still correct. The other issue that
can cause problems is that certain versions of redhat shipped
with bad perl distributions.
What I usually do is first, make sure the file is readable
in the path the script is expecting it, so do a
head /var/virtual-web/stats.i-way.net.uk/docs/lines-in-use/ras-lines
and make sure you have a valid MRTG log file still.
Next, I turn on DEBUG mode in MRTG, (this makes it very verbose,
but it's the only way I've found to get a full listing of what
arguments MRTG is trying to pass to rateup) and capture two or
three runs where it lists out everything it's going to do, including
what arguments it's going to pass to rateup. I then modify the
gen_one_gif script to make sure the same arguments are being
passed to the copy of rateup being called by it.
OH!
Actually, looking down below I see another problem. The "l"
flag doesn't have any arguments after it. It looks like the
shell changed slightly between your old box and your new box,
so that the quote characters that were being used to protect
your legend (the "l" argument) are no longer protecting the
legend properly. :(
Rateup is expecting a legend after the "l" flag, and it isn't
seeing one, so it gets confused and segfaults.
This would be a nasty shell issue, and not having any access
to a redhat linux box, I'm not sure if I could strictly tell
you the best way of escaping the quote characters to make sure
they stay intact in the shell. You might need to check on a
linux newsgroup or mailing list to find out how to protect
shell quote characters when passing commands from a perl
script to a system call.
Hope that helps!
Matt
> Here are the errors i get:
> [root at stats0 lines-in-use]# ./mrtg_gen_one_gif.pl day ras-lines.log
> LOGS: 0
> What to do is: day
> 3:01pm up 5 days, 40 min, 2 users, ::: 5.36, 4.05, 3.86
>
> Values were: 5.36, 4.05, 3.86
> about to do dir: /var/virtual-web/stats.i-way.net.uk/docs/lines-in-use
> BaseDir is: lines-in-use
> About to work with: ras-lines.log
> Basename is: ras-lines
> Speed is: 7000
> Unscaled is: -1
> doing dir=/var/virtual-web/stats.i-way.net.uk/docs/lines-in-use,
> base=ras-lines, speed=7000
> command would be:
> /usr/bin/rateup /var/virtual-web/stats.i-way.net.uk/docs/lines-in-use
> ras-lines c #00cc00 #0000ff #006600 #ff00ff l i ras-lines-day.gif -7000
> 400 100 1 1 1 300 0
> Rateup ERROR: /usr/bin/rateup found ras-lines's log file was corrupt
> or not in sorted order.Rateup WARNING: /usr/bin/rateup could
> not read the primary log file for ras-lines
> Rateup WARNING: /usr/bin/rateup The backup log file for ras-lines was
> invalid as well
>
> PROBLEM: rateup died from Signal 11
> with Exit Value 0 when doing router 'ras-lines'
> If this happens all the time,
> you should probably investigate the cause. :-)
>
> I don't understand why the logs should look corrupt to mrtg and why this
> works with my other box. On the new box i'm using perl 5.004_5, on the old
> one 5.004_4. I have also tried putting 2.5.2 and the rateup binary from the
> old box
> on the new one. Signal 11 is sigsegv.
>
> Thanks in advance.
>
> Andrew
>
> Andrew Thompson
> Network Manager
> I-Way Ltd
> andrewt at i-way.net.uk
> +44 (0)118 958 0058
>
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Help mailto:mrtg-request at list.ee.ethz.ch?subject=help
> Archive http://www.ee.ethz.ch/~slist/mrtg
>
>
--
Concentric Network | Matthew Petach {MP59}
Senior Network Architect | mpetach at concentric.net
1400 Parkmoor Avenue | Tel: (408) 817-2535
San Jose, CA 95126-3429 | Fax: (408) 817-2630
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive http://www.ee.ethz.ch/~slist/mrtg
More information about the mrtg
mailing list