【问题标题】:Iptables rules and zabbix Item keyiptables规则和zabbix Item key
【发布时间】:2020-07-16 14:14:15
【问题描述】:

我在 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

我们需要从中统计传入和传出的流量,并将其全部显示在zabbix中。

当我在 Zabbix 中创建项目时,对于第一条规则链,不计算流量 iptables.rule.count[INPUT] iptables.rule.count[OUTPUT] 对于第二条链,通过港口,一切正常 iptables.rule.traffic[INPUT,1935] iptables.rule.traffic[OUTPUT,1935] 我做错了什么?

Zabbix 代理配置: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}' 我需要替换正确的密钥,但是哪个?

【问题讨论】:

    标签: key iptables zabbix


    【解决方案1】:

    明白了,关键参数一定是ip

    【讨论】:

    • @Jeremy Caney 回答
    猜你喜欢
    • 1970-01-01
    • 2023-03-03
    • 1970-01-01
    • 2012-08-31
    • 2013-04-09
    • 2021-09-11
    • 2014-03-13
    • 2017-11-30
    • 2014-01-30
    相关资源
    最近更新 更多