collectd / collectd

The system statistics collection daemon. Please send Pull Requests here!
http://collectd.org
Other
3.17k stars 1.23k forks source link

Iptables Plugin Does Not Support NAT Table Metrics - Ubuntu 14.04 #1478

Open fooka03 opened 8 years ago

fooka03 commented 8 years ago

We have three NAT servers we would like to monitor traffic on but the iptables plugin is not reporting any statistics. I've tried several configurations, even down to compiling from source with libiptc with no luck.

This has been tested with 5.4.0 (ubuntu apt package), 5.4.0 (compiled from source tag), 5.5.0 (from collectd-ci apt package), and 5.5.0 (compiled from source tag). Here is my configuration:

<Plugin iptables>
    Chain "nat" "POSTROUTING"
</Plugin>

Nothing too exciting, but nothing is collected. Here is the output for that chain from iptables -Lnv:

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 5765  348K MASQUERADE  all  --  *      eth0    10.3.0.0/16          0.0.0.0/0

Some info for the server I'm running: Kernel: 3.13.0-73 OS: Ubuntu 14.04.3 LTS Iptables: 1.4.21

derfabianpeter commented 7 years ago

Any update on this? Would need to collect -t nat and -t raw too!

rpv-tomsk commented 7 years ago
Chain Table Chain [Comment|Number [Name]]
       Chain6 Table Chain [Comment|Number [Name]]
           Select the iptables/ip6tables filter rules to count packets and
           bytes from.

           If only Table and Chain are given, this plugin will collect the
           counters of all rules which have a comment-match. The comment is
           then used as type-instance.

Did you try to set comment (-m comment --comment='type_instance') to your iptables rules?