got this from MRTG/site/something/fromsomeone then just modified it for my env.

#mrtg.cfg
#
WorkDir: /var/apache/htdocs/mrtg
Target[in_packets]: `/root/getraffic mylinuxbox eth0`
Options[in_packets]: growright, bits
MaxBytes[in_packets]: 10000000
Title[in_packets]: MRTG Traffic
PageTop[in_packets]: <h1>Stats of my box</h1>


#!/bin/sh
# usage: gettraffic mylinuxbox eth0
#
grep="/bin/grep"
cut="/usr/bin/cut"
uptime="/usr/bin/uptime"
devsta="/proc/net/dev"
name=$1
interface=$2
line=`/bin/cat $devsta | $grep "$interface"`
line=`echo $line | $cut -d":" -f 2`
ibytes=`echo $line | $cut -d" " -f 1`
obytes=`echo $line | $cut -d" " -f 9`
uptim=`$uptime | $cut -d"," -f1,2`
uptim=`echo $uptim | $cut -d" " -f3,4,5,6`
echo $ibytes
echo $obytes
echo $name
echo $uptim

hth,
jun

Jesus, Jr. C. Enerio wrote:
Pluggers,

Anybody know how to monitor ethernet ports using cfgmaker? I've tried to do so using instructions on their webpage but it always end up with an empty mrtg.cfg. Any body with an idea?

Thanks
Jess


_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph

To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL PROTECTED]

Reply via email to