[ LUGOS ] MRTG configure

Uro¹ Gruber uros at sir-mag.com
Sun Oct 22 23:34:17 CEST 2000


Hoj,

Sunday, October 22, 2000, 12:43:21 AM, you wrote:

>> mene zanima kako skonfigurirat oz kaj napisat pod target v cfg
>> datoteki MRTGja da mi bo gledal promet na eni mrezni kartici enga
>> serverja. Recimo da ma ta mrezna ip 192.168.0.10

Matija> ALi imas pravico pobirat SNMP iz routerja/switcha? Ce je, potem si 
Matija> kar poglej navadna navodila za konfiguracijo na http://www.mrtg.org/

Matija> Ce ne mores pobirati iz routerja, ampak bi res rad direktno iz streznika, 
Matija> potem pa

Matija> mrtg.cfg:

Matija> Target[eth0]: `/usr/local/bin/ethpackets`
Matija> MaxBytes[eth0]: 12500000
Matija> Title[eth0]: Eth0 traffic
Matija> Options[eth0]: bits, growright
Matija> PageTop[eth0]: <H1>Eth0 Traffic</H1>
Matija> YLegend[eth0]: bits
Matija> LegendI[eth0]: bits in
Matija> LegendO[eth0]: bits out
Matija> Legend1[eth0]: bits in
Matija> Legend2[eth0]: bits out


Matija> Ethpackets:
Matija> #!/usr/bin/perl
Matija> open(INP,"</proc/net/dev") || die "Can not open /proc/net/dev: $!";
Matija> while (<INP>) {
Matija>     @a=split;
Matija>     print "$a[0]\n$a[9]\n" if ($a[0]=~s/eth0://);
Matija> }



Vse lepo in prav. Skripta dela. edino kar je problem je da mrtg kaze
za IN in OUT enako. Zgleda nekaj ne deluje pravilno.

Testiral sem tako da sem nekaj dljal in ni nič kazalo pod current,
medtem ko ce sem uploadal pa je kazalo.

Katere dve številke pričakuje mrtg.

Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
    lo: 2208455   18133    0    0    0     0          0         0  2208455   18133    0    0    0     0       0          0
 dummy:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
  eth0:285712620 1485463    0    0    0     0          0         0 278771270 1228755    0    0    0  1113       0          0
  
  Tole mi izpise iz fila /proc/net/dev

  Če pogledam skripto je ena napaka naprec za recive dobiva byte
  medtem ko za send pa pakete.

  Imam pa en programcek ko  v konzoli kaze prenose iz tega fila pa
  deluje pravilno.

  
-- 
lp,
 Uroš







More information about the lugos-list mailing list