[mrtg] Re: Redhat Linux performance metrics
Andre Timmermann
timmerma at ba-loerrach.de
Mon Jun 30 21:10:46 MEST 2003
Am Mon, 2003-06-30 um 19.33 schrieb Drew Weaver:
> Does anyone have a decent config file or any advice on using
> MRTG to gather performance metrics from a Redhat Linux system, specifically
> I need to track IO usage, CPU usage, Memory Usage?
Hi Drew,
I have a sample for CPU-usage an memory:
# User vs Idle CPU usage
# ------------------------
Target[cpu]:ssCpuRawUser.0&ssCpuRawIdle.0:public at localhost
RouterUptime[cpu]: public at localhost
MaxBytes[cpu]: 400
Title[cpu]: CPU LOAD
PageTop[cpu]: <H1>User CPU Load %</H1>
Unscaled[cpu]: ymwd
ShortLegend[cpu]: %
YLegend[cpu]: CPU Utilization
Legend1[cpu]: User CPU in % (Load)
Legend2[cpu]: Idle CPU in % (Load)
Legend3[cpu]:
Legend4[cpu]:
LegendI[cpu]: User
LegendO[cpu]: Idle
Options[cpu]: growright,nopercent
# User vs System CPU usage
# ----------------------------
Target[usrsys]:ssCpuRawUser.0&ssCpuRawSystem.0:public at localhost
RouterUptime[usrsys]: public at localhost
MaxBytes[usrsys]: 110
AbsMax[usrsys]: 11000000
Title[usrsys]: CPU LOAD
PageTop[usrsys]: <H1>CPU (user and system) Load %</H1>
Unscaled[usrsys]: ymwd
ShortLegend[usrsys]: %
YLegend[usrsys]: CPU Utilization
Legend1[usrsys]: User CPU in % (Load)
Legend2[usrsys]: System CPU in % (Load)
Legend3[usrsys]:
Legend4[usrsys]:
LegendI[usrsys]: User
LegendO[usrsys]: System
Options[usrsys]: growright,nopercent
# Active CPU usage
# ------------------
Target[cpusum]:ssCpuRawUser.0&ssCpuRawUser.0:public at localhost +
ssCpuRawSystem.0&ssCpuRawSystem.0:public at localhost +
ssCpuRawNice.0&ssCpuRawNice.0:pu
blic at localhost
RouterUptime[cpusum]: public at localhost
MaxBytes[cpusum]: 200
AbsMax[cpusum]: 2000000
Title[cpusum]: CPU LOAD
PageTop[cpusum]: <H1>Active CPU Load %</H1>
Unscaled[cpusum]: ymwd
ShortLegend[cpusum]: %
YLegend[cpusum]: CPU Utilization
Legend1[cpusum]: Active CPU in % (Load)
Legend2[cpusum]:
Legend3[cpusum]:
Legend4[cpusum]:
LegendI[cpusum]: Active
LegendO[cpusum]:
Options[cpusum]: growright,nopercent
#
# Memory Utilization
# -------------------
Target[memory]: `/etc/mrtg/scripts/memstat.sh`
Options[memory]: nopercent,gauge,noinfo,growright
Title[memory]: Memory Utilization
PageTop[memory]: <h1>Memory Utilization</h1>
#MaxBytes[memory]: 100000000
kMG[memory]: ,M,G,T,P,X
YLegend[memory]: RAM Utilization
ShortLegend[memory]: bytes
Legend1[memory]: Used memory
Legend2[memory]: Free memory
Legend3[memory]: Maximum free memory
Legend4[memory]: Maximum used memory
LegendI[memory]: Free mem
LegendO[memory]: Used mem
RouterUptime[memory]: public at localhost
You will need this script:
/etc/mrtg/scripts/memstat.sh:
#!/bin/sh
PATH=/bin:/usr/bin
statname="Memory Usage"
mem=`free | grep Mem`
free=`echo $mem | awk '{ print $3 }'`
used=`echo $mem | awk '{ print $4 }'`
echo $free
echo $used
uptime | cut -d, -f 1 | awk '{print $3, $4}'
echo $statname
Ok, I think this is not very pretty, but it works ;o)
Greetz,
Andre
--
André Timmermann
Wirtschaftsinformatikassistent (BA)
Berufsakademie Lörrach (BWÜ)
--
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