From: "Jeffrey D. Brower" <jeff@pointhere.net>
To: Chris Wilson <chris@netservers.co.uk>
Cc: netfilter@lists.netfilter.org
Subject: Re: real-time monitor question
Date: Tue, 5 Aug 2003 14:10:45 -0400 [thread overview]
Message-ID: <042501c35b7c$e3e565c0$0b02a8c0@pointhere.net> (raw)
In-Reply-To: Pine.LNX.4.44.0308051013000.21531-100000@localhost
> I think that ulogd, and the ULOG target which feeds it, are the best
> solution in this case.
Based on that statement I got more deeply into the ULOG and it looks good.
I found an extention in the CVS called ulogd_OPRINT.c which (although I can
not find the documentation on its use) LOOKS like it is almost exactly what
I need. Can it be that my solution could be as simple as replacing the
_output_print() function with my own function that prints to the circuit
board?
> Why is that? It seems to be the best way to distinguish between packets
> being dropped in different places.
I was really refering to the horrors of a huge syslog as each packet gets
logged and reading that log file to drive the circuit board and all the
maintenance nightmares with it.
> If you only want a graph of ALL packets
> accepted and ALL packets dropped, then just create a couple of chains:
>
> iptables -N my_accept
> iptables -A my_accept -j ULOG --ulog-prefix "ACCEPT"
> iptables -A my_accept -j ACCEPT
>
> iptables -N my_drop
> iptables -A my_drop -j ULOG --ulog-prefix "DROP"
> iptables -A my_drop -j DROP
This confused me until I realized that the ULOG returns the packets for
further processing. I had (in error) thought that I would have to deal with
the packet resolution in userspace.
> > It occurs to me that there might be something I can do with the /proc
files.
>
> As far as I know there are no counters of ACCEPTed/DROPped packets in
/proc
Another suggestion that I got kind of steered me toward lookng at bytes
rather than packets and I wonder if I can't just read one of the /proc files
to see the number of bytes accepted and denyed - the assumption being that I
could log bytes to the board and let the log files watch for connections
keeping the size of the log file down while still presenting a real-time
interface for the operator via the circuit board. As I understand it, I can
read a /proc file 10 times a second with little impact on the system (as
bizzare as that sounds to me).
> but you could run "iptables -L -n -v" and parse the output to see the
number of
> packets dropped at each rule.
seems like a lot of overhead.
> Maybe have a process which fork()s with either end of a pipe(). One
> process reads from Netfilter and writes to the pipe every so often (with a
> non-blocking write), while the other process reads from the pipe and
> writes to the hardware.
Never having done a fork(), nor a pipe() nor reads from Netfilter - this
sounds like a lot of fun to me (but like a heck of a learning curve). It
sounds like what I envisioned, but I wonder if the pipe won't get stuffed
too fast and halt the input side causing lost packets, etc. It really seems
like this exactly what I need to code in the _output_print() function of
the ulogd_OPRINT.c program - but again, how do I keep it from over-running
the pipe?
> Hope this helps!
Yes it did.
next prev parent reply other threads:[~2003-08-05 18:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-04 17:31 real-time monitor question Jeffrey D. Brower
2003-08-05 9:20 ` Chris Wilson
2003-08-05 18:10 ` Jeffrey D. Brower [this message]
2003-08-06 9:27 ` Chris Wilson
2003-08-06 15:49 ` Jeffrey D. Brower
2003-08-06 15:48 ` Chris Wilson
[not found] <09B04A55822EFF4DA48D2E0BB2941D4A15C03F@wardrive.citadelcomputer.com.au>
2003-08-05 1:32 ` Jeffrey D. Brower
-- strict thread matches above, loose matches on Subject: below --
2003-08-05 1:44 George Vieira
2003-08-05 18:10 ` Jeffrey D. Brower
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='042501c35b7c$e3e565c0$0b02a8c0@pointhere.net' \
--to=jeff@pointhere.net \
--cc=chris@netservers.co.uk \
--cc=netfilter@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.