🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.os.linux.sieci
Article #244051

Re: ipt_account, layer-7

#244051
From: WOJO
Date: Tue, 31 Dec 2013 06:42
35 lines
2456 bytes
> hostów ok 50,
> tak myśle że przydałby sie skrypt do mrtg wydobywający dane?
To nie powinno wolno działać (przy założeniu, że sprzęt, którym dysponujesz 
nie jest archaiczny). Może gdzieś pętle masz w regułach iptables.

> jest czansa, że podzielisz sie rozwiązaniem które podejrzewam
> funkcjonuje u Ciebie?

Skrypt uruchomieniowy ip.sh (np. w /etc/mrtg/source)
#!/bin/bash
iptables -v -n -x -L rc.mrtg | grep $1 | head -1 | awk '{print $2}'
iptables -v -n -x -L rc.mrtg | grep $1 | tail -1 | awk '{print $2}'
uptime | sed -e 's/^.*up *//g' -e 's/, *[0-9] *u.*$//g'
hostname

Miałem gdzieś generator napisany w php odwołujący się bezpośrednio do bazy 
postgres, ale posiałem, więc będziesz musiał sobie sam powielić dla 50 
hostów.
Fragment pliku konfiguracyjnego mrtg
Directory[ip2]:         ip/ip2
Target[ip2]:            `/etc/mrtg/source/ip.sh 192.168.0.2`
Title[ip2]:             Ruch generowany przez host 192.168.0.2
Options[ip2]:           growright, nobanner
MaxBytes1[ip2]:         512000
AbsMax[ip2]:            520000
#XSize[ip2]:            600
#YSize[ip2]:            200
YLegend[ip2]:           kB/sec
#Unscaled[ip2]:         dwmy
MaxBytes2[ip2]:         64000
PageTop[ip2]:           <H1>HOST 192.168.0.2</H1>

Stronę ze statystykami musisz sobie stworzyć sam...
Pozdrawiam.
WOJO 
Technical Details
Message-ID: <l9tovm$bm3$1@node2.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <l9rmrn$4rp$1@news.task.gda.pl> <l9ro32$68g$1@node1.news.atman.pl> <l9rqun$arr$1@news.task.gda.pl> <l9rrru$a1b$1@node1.news.atman.pl> <l9rs83$c7l$1@news.task.gda.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: "WOJO" <sorry@address.unknown.hehe>
Newsgroups: pl.comp.os.linux.sieci
Subject: Re: ipt_account, layer-7
Date: Tue, 31 Dec 2013 07:42:00 +0100
Organization: ATMAN - ATM S.A.
Lines: 36
Message-ID: <l9tovm$bm3$1@node2.news.atman.pl>
References: <l9rmrn$4rp$1@news.task.gda.pl> <l9ro32$68g$1@node1.news.atman.pl> <l9rqun$arr$1@news.task.gda.pl> <l9rrru$a1b$1@node1.news.atman.pl> <l9rs83$c7l$1@news.task.gda.pl>
NNTP-Posting-Host: host-89-167-78-235.nplay.net.pl
Mime-Version: 1.0
X-Trace: node2.news.atman.pl 1388472118 11971 89.167.78.235 (31 Dec 2013 06:41:58 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Tue, 31 Dec 2013 06:41:58 +0000 (UTC)
In-Reply-To: <l9rs83$c7l$1@news.task.gda.pl>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 16.4.3508.205
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3508.205
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit