/home/mip/www/img/credit/datatables/mrtg.tar
system 0000755 00000002207 15152102705 0006015 0 ustar 00 #!/bin/sh
TYPE=$1
PARAM=$2
if [ "$TYPE" = "load" ]; then
INDATA=`cat /proc/loadavg | cut -d ' ' -f2 | sed 's/\.//g' | sed 's/^0//g'`
OUTDATA=`cat /proc/loadavg | cut -d ' ' -f3 | sed 's/\.//g' | sed 's/^0//g'`
fi
if [ "$TYPE" = "processes" ]; then
INDATA=`cat /proc/loadavg | cut -d ' ' -f4 | cut -d '/' -f 2`
OUTDATA=`cat /proc/loadavg | cut -d ' ' -f4 | cut -d '/' -f 1`
fi
if [ "$TYPE" = "network" ]; then
LINE=`cat /proc/net/dev | grep $PARAM | sed s/$PARAM://`
INDATA=`echo $LINE | awk '{print $1}' `
OUTDATA=`echo $LINE | awk '{print $9}' `
fi
if [ "$TYPE" = "swap" ]; then
SWAPFREE=`cat /proc/meminfo | grep "SwapFree" | sed 's/ * / /g' | cut -d ' ' -f2`
SWAPTOTAL=`cat /proc/meminfo | grep "SwapTotal" | sed 's/ * / /g' | cut -d ' ' -f2`
SWAPUSED=`expr $SWAPTOTAL - $SWAPFREE`
INDATA=$SWAPFREE
OUTDATA=$SWAPUSED
fi
if [ "$TYPE" = "uptime" ]; then
INDATA=`cat /proc/uptime | cut -d ' ' -f1`
OUTDATA=`cat /proc/uptime | cut -d ' ' -f2`
fi
if [ "$TYPE" = "tcp" ]; then
INDATA=`netstat -an | grep -c ESTABLISHED`
OUTDATA=$INDATA
fi
echo $INDATA
echo $OUTDATA
echo `uptime | cut -d"," -f1,2`
echo $TYPE
mrtg.cfg_l 0000644 00000000000 15152102705 0006475 0 ustar 00 mrtg.cfg 0000755 00000012360 15152102705 0006201 0 ustar 00 ###############################################################################
# Multi Router Traffic Grapher -- Configuration File
###############################################################################
WorkDir: /var/www/html/mrtg
RunAsDaemon:Yes
Interval:5
Options[_]: nopercent,growright,nobanner,nolegend,noinfo,gauge,withzeroes
MaxBytes[_]: 125000000
###############################################################################
#
# HTML formatting stuff
#
###############################################################################
PageTop[^]: <table cellspacing="0" cellpadding="10" border="0" width="100%" align="center"><tr><td width="185" valign="top" class="small"><table cellspacing="0" cellpadding="5" border="0" width="100%"><tr><td class="tableh">Network</td></tr><tr><td class="tablesh"><a href="index.html">- Traffic</a></td></tr><tr><td> </td></tr><tr><td class="tableh">System Stats</td></tr><tr><td class="tablesh"><a href="load.html">- Load Averages</a><br><a href="swap.html">- Swap Memory</a><br><a href="processes.html">- Processes</a><br><a href="uptime.html">- Uptime and Idle Time</a><br><a href="cpu.html">- CPU</a></td></tr><tr><td> </td></tr></table></td><td>
PageFoot[^]: </td></tr></table>
AddHead[^]: <style><!-- body { text-align: center; background-color: #CCCCCC; font-size: 10pt; font-family: arial, verdana; } th, td { font-size: 10pt; font-family: arial, verdana; } h3 { font-size: 12pt; font-family: arial, verdana; font-weight: bold; } .small { font-size: 8pt; font-family: arial, verdana; } .tableh { font-size: 10pt; font-family: arial, verdana; color: white; background-color: black; font-weight: bold; } .tablesh { font-size: 10pt; font-family: arial, verdana; color: black; background-color: #999999; font-weight: normal; } a:visited, a:active, a:link { text-decoration: none; font-weight: normal; font-family: arial, verdana; color: black; } a:hover { font-weight: normal; font-family: arial, verdana; background-color: #999999; color: white; } --></style>
###############################################################################
#
# Stats
#
###############################################################################
#----------------------------
# Network
#----------------------------
Options[index]: nopercent,growright,nobanner,noinfo,nolegend,bits
Target[index]: `/etc/mrtg/system network eno1`
Title[index]: Traffic Analysis For eno1
PageTop[index]: <h3>Traffic Analysis For eno1 (208.76.83.45)</h3>
#----------------------------
# Load
#----------------------------
Target[load]: `/etc/mrtg/system load`
Title[load]: Load Averages (*100)
PageTop[load]: <h3>Load Averages For 208.76.83.45</h3>
YLegend[load]: Load Averages
ShortLegend[load]:
LegendI[load]: 5-minute Load
LegendO[load]: 15-mintute Load
#----------------------------
# Swap
#----------------------------
Target[swap]: `/etc/mrtg/system swap`
Title[swap]: Swap Memory Usage
PageTop[swap]: <h3>Swap Memory Usage For 208.76.83.45</h3>
YLegend[swap]: Swap Usage
ShortLegend[swap]:
LegendI[swap]:
LegendO[swap]: Used
#----------------------------
# Processes
#----------------------------
Target[processes]: `/etc/mrtg/system processes`
Title[processes]: Processes
PageTop[processes]: <h3>Processes For 208.76.83.45</h3>
YLegend[processes]: Processes
ShortLegend[processes]:
LegendI[processes]: Total
LegendO[processes]: Running
#----------------------------
# Uptime
#----------------------------
Target[uptime]: `/etc/mrtg/system uptime`
Title[uptime]: Uptime and Idle Time
PageTop[uptime]: <h3>Uptime and Idle Time For 208.76.83.45</h3>
YLegend[uptime]: Uptime (sec)
ShortLegend[uptime]:
LegendI[uptime]: Total Uptime
LegendO[uptime]: Idle Time
#----------------------------
# CPU
#----------------------------
Target[cpu]: `/usr/bin/awk '/cpu /{print $2+$3; print $2+$3+$4; print "quite some time"; print "4-225.servernode.net"}'</proc/stat`
Title[cpu]: CPU Usage
PageTop[cpu]: <H3>CPU Usage For 208.76.83.45</H3>
MaxBytes[cpu]: 100
Options[cpu]: nopercent,growright,nobanner,noinfo,nolegend,bits
LegendI[cpu]: user:
LegendO[cpu]: total:
Ylegend[cpu]: %CPU
ShortLegend[cpu]: %CPU
Legend1[cpu]: Time spent in user mode
Legend2[cpu]: Time spent in user mode + time spent in system mode
Legend3[cpu]: Maximum occurance of time spent in user mode
Legend4[cpu]: Maximum occurance of (time spent in user mode + time spent in system mode)
#----------------------------
# Memory
#----------------------------
Target[localhost.mem]: `free -bt | grep buffers\/cache | awk '{print $3"\n"$4}'`
MaxBytes[localhost.mem]: 665536000
Title[localhost.mem]: Memory Utilization
PageTop[localhost.mem]: <H3>Memory Utilization For 208.76.83.45</H3>
Options[localhost.mem]: nopercent,growright,nobanner,noinfo,nolegend,bits
YLegend[localhost.mem]: Bytes
ShortLegend[localhost.mem]: B
Legend1[localhost.mem]: Free real memory
Legend2[localhost.mem]: Free swap memory
Legend3[localhost.mem]: Maximal 5 Minute Memory In Use
Legend4[localhost.mem]: Maximal 5 Minute Active Memory
LegendI[localhost.mem]: Used:
LegendO[localhost.mem]: B+C:
XSize[localhost.mem]: 350
mrtg.pid 0000644 00000000005 15152102705 0006204 0 ustar 00 8985