Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Re: MRTG without SNMP: how-to?



Jean-Christian Imbeault wrote:
> Does anyone remember that posting, or better yet can the original poster 
> (Tobias maybe?) explain again how to get network usage stats without using 
> SNMP?

/etc/mrtg.cfg:
|######################################################################
|# Multi Router Traffic Grapher -- Sample Configuration File
|######################################################################
|# This file is for use with mrtg-2.5.4c
|
|# Global configuration
|WorkDir: /var/www/router/mrtg
|WriteExpires: Yes
|
|#Title[^]: Traffic Analysis for
|
|Title[ppp0]: router ADSL connection Traffic
|PageTop[ppp0]: <H1>Traffic analysis for ppp0</H1>
|Target[ppp0]: `/usr/local/bin/routerstats`
|MaxBytes1[ppp0]: 96000
|MaxBytes2[ppp0]: 16000
|WithPeak[ppp0]: wmy
|
|Title[temp]: CPU and GPU Temperature
|PageTop[temp]: <H1>CPU and GPU temperature</H1>
|Target[temp]: `/usr/local/bin/routertemp`
|MaxBytes[temp]: 100
|WithPeak[temp]: wmy
|Options[temp]: gauge
|YLegend[temp]: Temperature in degree Celsius
|ShortLegend[temp]: °C
|Legend1[temp]: CPU Temperature
|Legend2[temp]: GPU Temperature
|Legend3[temp]: Maximal 5 Minute CPU Temperature
|Legend4[temp]: Maximal 5 Minute GPU Temperature
|LegendI[temp]: &nbsp;CPU:
|LegendO[temp]: &nbsp;GPU:

/usr/local/bin/routerstats:
|#!/bin/sh
|PATH=/bin:/usr/bin:/usr/local/bin
|IN=`cat /proc/net/dev | awk 'index($1,"ppp0") != 0 { print substr($0,8) }' | awk '{ print $1}'`
|OUT=`cat /proc/net/dev | awk 'index($1,"ppp0") != 0 { print substr($0,8) }' | awk '{ print $9}'`
|if [ "$IN" = "" ]; then IN="0"; fi
|if [ "$OUT" = "" ]; then OUT="0"; fi
|echo "$IN"
|echo "$OUT"
|uptime
|hostname

-- 
Tobias								PGP: 0x9AC7E0BC
This mail is made of 100% recycled bits
Now playing: hayashibaramegumi: bertemu 06 - matsuriuta

Attachment: pgp00022.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links