[mrtg] free &used memory are 0?

Marco Ledebur marco.ledebur at desy.de
Fri Oct 29 10:15:41 MEST 2004


Hello folks!

I use MRTG-2.10.15 to monitoring the CPU trouble, I/O trouble and free & 
used memory of my linux machine.
For all three measurements I use perl scripts.
CPU & I/O trouble monitoring works fine.

With a perl script I get the value of the memory from the top-function.
I get some value which are right, but the rest of the time free and used
memory got the value 0.
When I execute the perl script or start mrtg in the terminal it always 
shows the right values. But MRTG-graphs shows 0.

Here the perl script I use: memory.pl
    
    #!/usr/bin/perl
    $f="%.0f";
    $fmt="$f\n$f\nMemory used/free\n";
    @p=split(' ',(qx(top -n3 |grep Mem |tail -1)));
    
    @p[4]=~ s/k//;
    @p[6]=~ s/k//;

    $c1=@p[4]*1024;
    $c2=@p[6]*1024;

    $o=sprintf $fmt,$c1,$c2;
    print $o;

Here an abridgement from my mrtg.cfg :

    ...
    Target[memory]: `/usr/local/mrtg-2/config/memory.pl`
    Options[memory]: gauge, growright, transparent, noinfo, nopercent, 
integer
    MaxBytes[memory]: 1300000000
    XSize[memory]: 600
    YSize[memory]: 200
    kilo[memory]: 1024
    YLegend[memory]:b
    ShortLegend[memory]:b
    Legend1[memory]: Used Memory
    Legend2[memory]: Free Memory
    Legend3[memory]: Maximal 10 Min
    Legend4[memory]: Maximal 10 Min
    LegendI[memory]:  used:
    LegendO[memory]:  free:
    Timezone[memory]: MET
    Title[memory]: Memory
    PageTop[memory]: <H2>Memory</H2>
    ...

Hope you can help me!

Marco

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