본문 바로가기
카테고리 없음

MRTG

by linix 2010. 3. 13.

#####################################################################

  Global Configuration Options
#####################################################################
EnableIPv6: no
Forks: 2
Logdir: /ford/.u_01/rmussell/mrtg/logs
Imagedir: /ford/.u_01/rmussell/mrtg/logs/images
Htmldir: /ford/.u_01/rmussell/mrtg/lovelgw
Timezone[_]: EST
Refresh: 300
######################################################################
# System specific configuration
#
######################################################################
#
# System CPU Information
#
Target[cpu.lovelgw]: `ssh -xq lovelgw.com ./cpu.sh`
Options[cpu.lovelgw]: gauge,pngdate,growright,nopercent
MaxBytes[cpu.lovelgw]: 100
ShortLegend[cpu.lovelgw]: %
Unscaled[cpu.lovelgw]: ymwd
YLegend[cpu.lovelgw]: CPU utilization (user/sys)
Legend1[cpu.lovelgw]: User
Legend2[cpu.lovelgw]: System
LegendI[cpu.lovelgw]:  User: 
LegendO[cpu.lovelgw]:  System: 
Directory[cpu.lovelgw]: lovelgw
Title[cpu.lovelgw]: lovelgw.com -- CPU Utilization
PageTop[cpu.lovelgw]: 

CPU Utilization -- lovelgw.com

# # System Memory Information # Target[mem.lovelgw]: `ssh -xq lovelgw.com ./mem.sh` Options[mem.lovelgw]: gauge,pngdate,growright,nopercent KMG[mem.lovelgw]: k,M,G,T,P,X MaxBytes[mem.lovelgw]:10000000000 Kilo[mem.lovelgw]: 1024 YLegend[mem.lovelgw]: Memory Availability (Swap/Phy) Legend1[mem.lovelgw]: Swap Available Legend2[mem.lovelgw]: Physical Free LegendI[mem.lovelgw]:  Swap Free: LegendO[mem.lovelgw]:  Physical Free: Directory[mem.lovelgw]: lovelgw Title[mem.lovelgw]: lovelgw.com -- Memory Utilization PageTop[mem.lovelgw]:

Memory Utilization -- lovelgw.com

# # System Paging Information # Target[page.lovelgw]: `ssh -xq lovelgw.com ./page.sh` Options[page.lovelgw]: gauge,pngdate,growright,nopercent MaxBytes[page.lovelgw]:10000000000 KMG[page.lovelgw]: k,M,G,T,P,X Kilo[page.lovelgw]: 1024 YLegend[page.lovelgw]: Paging Activity (PI/PO) Legend1[page.lovelgw]: Paged IN Legend2[page.lovelgw]: Paged Out LegendI[page.lovelgw]:  Paged In: LegendO[page.lovelgw]:  Paged Out: Directory[page.lovelgw]: lovelgw Title[page.lovelgw]: lovelgw.com -- Paging Activity PageTop[page.lovelgw]:

Paging Activity -- lovelgw.com

# # System Connections ACTIVE # Target[netstat.lovelgw]: `ssh -xq lovelgw.com ./connections.sh` Options[netstat.lovelgw]: gauge,pngdate,growright,nopercent,perminute,integer MaxBytes[netstat.lovelgw]: 10000 ShortLegend[netstat.lovelgw]: c/s YLegend[netstat.lovelgw]: TCP Connections Legend1[netstat.lovelgw]: ESTABLISHED Connections Legend2[netstat.lovelgw]: TIME_WAIT Connections LegendI[netstat.lovelgw]:  ESTABLISHED: LegendO[netstat.lovelgw]:  TIME_WAIT: Directory[netstat.lovelgw]: lovelgw Title[netstat.lovelgw]: lovelgw.com -- Active TCP Connections PageTop[netstat.lovelgw]:

Active TCP Connections -- lovelgw.com

# # System Connections FINWAIT # Target[netstat1.lovelgw]: `ssh -xq lovelgw.com ./connections1.sh` Options[netstat1.lovelgw]: gauge,pngdate,growright,nopercent,perminute,integer MaxBytes[netstat1.lovelgw]: 10000 ShortLegend[netstat1.lovelgw]: c/s YLegend[netstat1.lovelgw]: TCP Connections Legend1[netstat1.lovelgw]: FIN_WAIT_2 Connections Legend2[netstat1.lovelgw]:   LegendI[netstat1.lovelgw]:  ESTABLISHED: LegendO[netstat1.lovelgw]:   Directory[netstat1.lovelgw]: lovelgw Title[netstat1.lovelgw]: lovelgw.com -- Active FIN_WAIT_2 Connections PageTop[netstat1.lovelgw]:

Active FIN_WAIT_2 Connections -- lovelgw.com

# # WebServers Active # Target[web.lovelgw]: `ssh -xq lovelgw.com ./web.sh` Options[web.lovelgw]: gauge,pngdate,growright,nopercent,integer MaxBytes[web.lovelgw]: 300 ShortLegend[web.lovelgw]:   YLegend[web.lovelgw]: WebServers Legend1[web.lovelgw]: Configured Web Servers Legend2[web.lovelgw]: Active Web Servers LegendI[web.lovelgw]:  Configured: LegendO[web.lovelgw]:  Active: Directory[web.lovelgw]: lovelgw Title[web.lovelgw]: lovelgw.com -- WebServers Configured/Active PageTop[web.lovelgw]:

WebServers Configured/Active -- lovelgw.com

# # Connected Users # Target[users.lovelgw]: `ssh -xq lovelgw.com ./users.sh` Options[users.lovelgw]: gauge,pngdate,growright,nopercent,integer MaxBytes[users.lovelgw]: 100000 Shortlegend[users.lovelgw]:   YLegend[users.lovelgw]: Users (who) Legend1[users.lovelgw]: Users Logged On Legend2[users.lovelgw]:   LegendI[users.lovelgw]:  Logged On: LegendO[users.lovelgw]:   Directory[users.lovelgw]: lovelgw Title[users.lovelgw]: lovelgw.com -- Users Logged onto the system PageTop[users.lovelgw]:

Users Logged onto the system -- lovelgw.com

# # Number of Processes on the Host # Target[numproc.lovelgw]: `ssh -xq lovelgw.com ./numproc.sh` Options[numproc.lovelgw]: gauge,pngdate,growright,nopercent,integer MaxBytes[numproc.lovelgw]: 1000000 Shortlegend[numproc.lovelgw]:   YLegend[numproc.lovelgw]: Processes Legend1[numproc.lovelgw]: Processes Legend2[numproc.lovelgw]:   LegendI[numproc.lovelgw]:  Processes: LegendO[numproc.lovelgw]:   Directory[numproc.lovelgw]: lovelgw Title[numproc.lovelgw]: lovelgw.com -- Number of Processes on the Host PageTop[numproc.lovelgw]:

Number of Processes on the Host -- lovelgw.com

# # Processes in Run Queue / Blocked Queue # Target[proc.lovelgw]: `ssh -xq lovelgw.com ./proc.sh` Options[proc.lovelgw]: gauge,pngdate,growright,nopercent,integer MaxBytes[proc.lovelgw]: 10000000 Shortlegend[proc.lovelgw]:   YLegend[proc.lovelgw]: Run Queue Legend1[proc.lovelgw]: Processes Running Legend2[proc.lovelgw]: Processes Blocked LegendI[proc.lovelgw]:  Running: LegendO[proc.lovelgw]:  Blocked: Directory[proc.lovelgw]: lovelgw Title[proc.lovelgw]: lovelgw.com -- Processes in the Run Queue / Blocked Queue PageTop[proc.lovelgw]:

Processes in the Run Queue / Blocked Queue -- lovelgw.com

# # Interface Traffic for eth0 # Target[eth0.lovelgw]: `ssh -xq lovelgw.com ./traf1.sh` Options[eth0.lovelgw]: gauge,pngdate,growright,nopercent,bits MaxBytes[eth0.lovelgw]: 125000000 KMG[eth0.lovelgw]:M Kilo[eth0.lovelgw]: 1024 YLegend[eth0.lovelgw]: eth0 Traffic Legend1[eth0.lovelgw]: eth0/IN Legend2[eth0.lovelgw]: eth0/OUT LegendI[eth0.lovelgw]:  Bytes IN: LegendO[eth0.lovelgw]:  Bytes OUT: Directory[eth0.lovelgw]: lovelgw Title[eth0.lovelgw]: lovelgw.com -- Interface Traffic for HME0 PageTop[eth0.lovelgw]:

Interface Traffic for eth0 -- lovelgw.com


Code:
#!/bin/sh
# cpu.sh

vmstat 1 2 | tail -1 >> /tmp/vmstat.mrtg
cat /tmp/vmstat.mrtg | awk '{print $13}'
cat /tmp/vmstat.mrtg | awk '{print $14}'
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname
rm /tmp/vmstat.mrtg


Code:
#!/bin/sh
# mem.sh

MFREE=`free | grep Mem | awk '{print $4}'`
MBUFF=`free | grep Mem | awk '{print $6}'`
MCACH=`free | grep Mem | awk '{print $7}'`
MTOTA=`free | grep Mem | awk '{print $2}'`

let RESULT1=$MFREE+$MBUFF+$MCACH

free | grep Swap | awk '{print $4}'
echo $RESULT1
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname


Code:
#!/bin/sh
# page.sh

vmstat 1 2 | tail -1 >> /tmp/vmstat.mrtg2
cat /tmp/vmstat.mrtg2 | awk '{print $7}'
cat /tmp/vmstat.mrtg2 | awk '{print $8}'
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname
rm /tmp/vmstat.mrtg2


Code:
#!/bin/sh
# connections.sh

netstat -a | grep ESTABLISHED | wc -l | awk '{print $1}' 2>/dev/null >> /tmp/net
stat.mrtg
netstat -a | grep TIME_WAIT | wc -l | awk '{print $1}' 2>/dev/null >> /tmp/netst
at.mrtg
cat /tmp/netstat.mrtg
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname
rm /tmp/netstat.mrtg


Code:
#!/bin/sh
# connections1.sh
netstat -a | grep FIN_WAIT_2 | wc -l | awk '{print $1}' 2>/dev/null >> /tmp/nets
tat.mrtg
cat /tmp/netstat.mrtg
echo 0
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname
rm /tmp/netstat.mrtg


Code:
#!/bin/sh
# traf1.sh

sar -n DEV -f /var/log/sa/sa.`date +%G_%m_%d` | grep eth0 | grep -v Average | ta
il -1 | awk '{print $5}'
sar -n DEV -f /var/log/sa/sa.`date +%G_%m_%d` | grep eth0 | grep -v Average | ta
il -1 | awk '{print $6}'
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname


Code:
#!/bin/sh
# numproc.sh

ps -e | grep -v PID | wc -l | awk '{print $1}'
echo 0
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname


Code:
#!/bin/sh
# proc.sh
# Number of proc's in the r/b queue

vmstat 1 2 | tail -1 >> /tmp/vmstat.mrtg3
cat /tmp/vmstat.mrtg3 | awk '{print $1}'
cat /tmp/vmstat.mrtg3 | awk '{print $2}'
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname
rm /tmp/vmstat.mrtg3


Code:
#!/bin/sh
# users.sh

w | grep -v USER | grep -v up | wc -l >> /tmp/w.mrtg
cat /tmp/w.mrtg | awk '{print $1}'
echo 0
uptime | awk '{print $3 " " $4; }' | cut -f1 -d","
hostname
rm /tmp/w.mrtg