PDA

View Full Version : Monitoring of iptables traffic


limo
06-04-2006, 23:13
Hello all,

I just upgraded debian packages of zabbix
(http://www.zabbix.com/doku/doku.php?id=contrib:installdebian)

and there is possibility to monitor iptables rule traffic. I included small source of utility used to do this. It is used as external item:

UserParameter=iptb_out ,iptc_getrule filter from_us "$1" b
UserParameter=iptp_out ,iptc_getrule filter from_us "$1" p
UserParameter=iptb_in ,iptc_getrule filter to_us "$1" b
UserParameter=iptp_in ,iptc_getrule filter to_us "$1" p

Do not forget that iptc_getrule has to be setuid root:
chmod +s /usr/bin/iptc_getrule

If you want to see line numbers in your iptables, use
iptables -t filter -L FORWARD -n -v --line-numbers
Use linenumber as parameter for iptc_getrule (aka iptp_*[])

Feel free to use !
Lukas Macura