MRTG – Gráficos de Tráfego LINUX

É bem simples e vale a pena.

Ambiente: Linux Etch

apt-get install mrtg

verifique o tráfego: cat /proc/net/dev

Em seguda crie um scritp que colherá estes dados:

#!/bin/bash
cat /proc/net/dev | grep ethx| cut -d : -f 2 | awk ‘{ print $1; print $9 }’

Dê permição de execução do mesmo.

Configure o arquivo mrtg.cfg (em /etc/mrtg.cfg)

Target[trafego]: `/etc/mrtg/ethx`

MaxBytes[trafego]: 32000

AbsMax[trafego]: 32000

Para rodar então:

env LANG=C /usr/bin/mrtg /etc/mrtg.cfg –daemon

Pronto.

About fcacomputers

Just du it
This entry was posted in LINUX. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s