PDA

View Full Version : How to edit MRTG bytes/KB/MB/GB??


tranz
08-05-03, 12:04 PM
Dont know if this is the right location.

In MRTG how would I edit the server.cfg file to show MB and Gigs not just bytes?

On a Win2K box BTW.

Chicken
08-05-03, 03:54 PM
it might be easier (might NOT), to extract the data and convert it to something that suits your needs on a customer info page?

Note the '?' at the end of that 'suggestion' :D

tranz
08-05-03, 06:07 PM
lol, yeah I guess I can write something in PHP or even flash and have it pull the info from the MRTG logs.

Just thought there would be a simple way to edit the cfg file though.

suppleSupport
08-06-03, 03:08 AM
Originally posted by tranz:

Just thought there would be a simple way to edit the cfg file though.

cfgmaker?

tranz
08-06-03, 04:47 AM
cfgmaker will make the cfg file. Now that it is made I need to know how to show different sizes..

Right now it shows bytes. I want to show MB and gigs.

suppleSupport
08-06-03, 05:32 AM
Just a theory based on our own MRTG stuff:

If there's little or no traffic, it's counted in bytes.

When there's more it's in KB.

Even more and it's in MB's and GB's.

Not sure if that's useful, I still need to emerge from my early-morning-cloud.

I bet there's a way to show it in MB's and GB's when there isn't enough traffic, just don't know it yet, will keep looking (when I wake up).

tranz
08-06-03, 10:57 AM
Elevation,

Great and thank you for the news. if you do find anything let me know. otherwise I will just wait till it reaches those limits.

Dave
08-09-03, 01:00 AM
Hey Tony,
It does it on its own. IM me on ICQ and I will show you mine.

IdologicJeff
08-22-03, 06:35 PM
Can you post your cfg file? I've modified some of our .cfg files and the scripts associated with them, but I'd have to see it to advise you better.

Essentially what you have to do is, find the line in the .cfg file that points to the script that generates your x,y values. You then edit the script. Often in MRTG the script is a perl script or something similar.

Cheers
Jeff

Adam
09-13-03, 02:28 AM
I think Tony knows it shows in bytes until it reaches kbytes and then mbytes etc.... but what i think he is trying to ask is if there is anyway to have them show up as GB or MB all the time.

Ie even if its less than 1GB he may want it to show up as 0.025GB.

Am i correct in saying this Tony?

tranz
09-13-03, 04:08 AM
yes..

Adam
09-13-03, 04:18 AM
There was a tutorial on this i read once, as soon as i find it i'll post a link :)

tranz
09-13-03, 04:30 AM
cool, it might be of use to others as well. I have resorted to taking the info that MRTG pushes out and using a different charting engine for the gui charts for the user.

If this works then it will be easy as we will be just working on the gui and not the core functionality. Otherwise we will just take the output from our bandwidth provisioning applicance and parse through the raw data and generate it on the fly.