Hi, I'm having problems finding a decent way to monitor packets dropped by iptables in realtime.
I have this perl (microperl) script that reads STDIN line by line and parses the lines. I tried this to pipe syslog DROP messages to the script:
root@OpenWrt:/etc# logread -f|/etc/blacklist-realtime.pl
But when new syslog messages come in, the script never receives them. Same happens if I try to grep the lines from logread -f:
on first terminal I type:
root@OpenWrt:/etc# logread -f|grep hello
on second one I type:
root@OpenWrt:~# logger hello
...but I can't see anything on the first terminal. Just to prove that the script itself works:
root@OpenWrt:~# cat /etc/banner|/etc/blacklist-realtime.pl
Analyzing: _______ ________ __
Analyzing: | |.-----.-----.-----.| | | |.----.| |_
Analyzing: | - || _ | -__| || | | || _|| _|
Analyzing: |_______|| __|_____|__|__||________||__| |____|
Analyzing: |__| W I R E L E S S F R E E D O M
Terminating
I'm not very familiar with unix programming and how the pipes work, but shouldn't the script be able to analyze logread -f 's output line by line?
If you know any better way to monitor dropped packets, other than parsing syslog's output, that would be cool too. BTW, this is my 2nd day with openwrt, pretty damn awesome system it is.
(Last edited by keitsi on 23 Oct 2005, 23:04)
