[mrtg] Re: Accounting rules and MRTG

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Feb 3 00:57:21 MET 2001


John Oliver wrote:
> 
> Oh, is *that* all? :-)
> 
> I can't "compose a command that returns the statistics for a particular
> address" 'cause I don't know where or how those statistics are kept. 
> I've never done this before, so i don't know where to start...

Then why not just tell that.  In the manual page for ipchains
is described how to do accounting.

You don't know how to use IP chains; this is not a MRTG problem.

First rule of ipchains is: be careful.
If you do something wrong you might close yourself out (remote
administration) or at least disrupt normal services.

Simple command to count SMTP and NNTP traffic:

ipchains --new-chain account
ipchains --insert input --jump account
ipchains --insert account --protocol tcp --source-port  25 --bidirectional
ipchains --insert account --protocol tcp --source-port 119 --bidirectional

To list the numbers:
ipchains --list account --verbose --exact

Now my original answer:
Write a script that parses the output of that last command
(which I assumed you new about) and make it output some numbers
in MRTG compliant format (see reference.txt in the doc dir).

cheers,
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list