-1

I have chain of traffic rules in iptables,

    pkts      bytes target     prot opt in     out     source               destination         
  309231 1770353681 ACCEPT     all  --  *      *       192.168.0.10      0.0.0.0/0           
     146    14940 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:1935

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 37686575 packets, 126484725644 bytes)
    pkts      bytes target     prot opt in     out     source               destination         
  275808 18766166 ACCEPT     all  --  *      *       0.0.0.0/0            192.168.0.10     
     139    10129 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp spt:1935

from which we need to count incoming and outgoing traffic and display it all in zabbix.

When I create an item in Zabbix, for the first chain of rules, then traffic is not counted iptables.rule.count[INPUT] iptables.rule.count[OUTPUT] for the second chain, by port, everything works iptables.rule.traffic[INPUT,1935] iptables.rule.traffic[OUTPUT,1935] What am I doing wrong?

Zabbix agent conf: iptables.conf UserParameter=iptables.rule.count[*],sudo iptables -nvxL $1|grep $2|awk '{print $$1}' UserParameter=iptables.rule.traffic[*],sudo iptables -nvxL $1|grep $2|awk '{print $$2}' I need to substitute the correct key, but which one?

Bell
  • 49
  • 1
  • 8

1 Answers1

0

Understood, the key parameter must be ip

Bell
  • 49
  • 1
  • 8