Hi all,
I'm currently using the Zabbix Kafka connector to forward monitoring data from Zabbix Server to a Kafka broker, filtered by item tags (component Equals traps).
It works well, and I’m able to receive data on the Kafka server. However, I’ve noticed that only SNMP trap items include the IP address in the JSON payload — for example, within the value field:
{"clock":1753943385,"eventid":0,"groups":["Discovered hosts","Linux servers"],"host":{"host":"Linux Agent 1 SNMP","name":"Linux Agent 1 SNMP"},"item_tags":[{"tag":"component","value":"network"},{"tag":"c omp onent","value":"traps"}],"itemid":69831,"name":"SNMP traps (fallback)","ns":927270222,"severity":0,"source":" ","timestamp":0,"type":2,"value":"2025-07-31T14:29:45+0800 PDU INFO:\n version 1\n messageid 0\n errorindex 0\n community test\n transactionid 123\n receivedfrom UDP: [10.0.0.0]:12345-\u003e[10.0.0.3]:16233\n notificationtype TRAP\n errorstatus 0\n requestid 411124414\nVARBINDS:\n DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (26063765) 3 days, 0:23:57.65\n SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: IF-MIB::linkUp\n IF-MIB::ifIndex type=2 value=INTEGER: 2\n IF-MIB::ifAdminStatus type=2 value=INTEGER: 1\n IF-MIB::ifOperStatus type=2 value=INTEGER: 1"}
But when I filter for other tags (e.g., network), the resulting JSON doesn’t contain any IP address, only fields like host, itemid, value, etc.
{"clock":1753426594,"groups":["Virtual machines"],"host":{"host":"TEST-AD","name":"TEST-AD"},"item_tags":[{"tag":"component","value":"system"},{"tag":"na me" ,"value":"Diagnostic Policy Service"},{"tag":"service","value":"DPS"}],"itemid":68914,"name":"State of service "DPS" (Diagnostic Policy Service)","ns":46412707,"type":3,"value":0}
{"clock":1753426595,"groups":["Virtual machines"],"host":{"host":"TEST-AD","name":"TEST-AD"},"item_tags":[{"tag":"component","value":"system"},{"tag":"na me" ,"value":"Windows Event Log"},{"tag":"service","value":"EventLog"}],"itemid":68915,"name":"State of service "EventLog" (Windows Event Log)","ns":46123639,"type":3,"value":0}
As someone still new to Zabbix, I'm not sure of the best way to include the host IP address in all data sent via the Kafka connector. A few questions:
I'm currently using the Zabbix Kafka connector to forward monitoring data from Zabbix Server to a Kafka broker, filtered by item tags (component Equals traps).
It works well, and I’m able to receive data on the Kafka server. However, I’ve noticed that only SNMP trap items include the IP address in the JSON payload — for example, within the value field:
{"clock":1753943385,"eventid":0,"groups":["Discovered hosts","Linux servers"],"host":{"host":"Linux Agent 1 SNMP","name":"Linux Agent 1 SNMP"},"item_tags":[{"tag":"component","value":"network"},{"tag":"c omp onent","value":"traps"}],"itemid":69831,"name":"SNMP traps (fallback)","ns":927270222,"severity":0,"source":" ","timestamp":0,"type":2,"value":"2025-07-31T14:29:45+0800 PDU INFO:\n version 1\n messageid 0\n errorindex 0\n community test\n transactionid 123\n receivedfrom UDP: [10.0.0.0]:12345-\u003e[10.0.0.3]:16233\n notificationtype TRAP\n errorstatus 0\n requestid 411124414\nVARBINDS:\n DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (26063765) 3 days, 0:23:57.65\n SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: IF-MIB::linkUp\n IF-MIB::ifIndex type=2 value=INTEGER: 2\n IF-MIB::ifAdminStatus type=2 value=INTEGER: 1\n IF-MIB::ifOperStatus type=2 value=INTEGER: 1"}
But when I filter for other tags (e.g., network), the resulting JSON doesn’t contain any IP address, only fields like host, itemid, value, etc.
{"clock":1753426594,"groups":["Virtual machines"],"host":{"host":"TEST-AD","name":"TEST-AD"},"item_tags":[{"tag":"component","value":"system"},{"tag":"na me" ,"value":"Diagnostic Policy Service"},{"tag":"service","value":"DPS"}],"itemid":68914,"name":"State of service "DPS" (Diagnostic Policy Service)","ns":46412707,"type":3,"value":0}
{"clock":1753426595,"groups":["Virtual machines"],"host":{"host":"TEST-AD","name":"TEST-AD"},"item_tags":[{"tag":"component","value":"system"},{"tag":"na me" ,"value":"Windows Event Log"},{"tag":"service","value":"EventLog"}],"itemid":68915,"name":"State of service "EventLog" (Windows Event Log)","ns":46123639,"type":3,"value":0}
As someone still new to Zabbix, I'm not sure of the best way to include the host IP address in all data sent via the Kafka connector. A few questions:
- Does Zabbix only embed the IP in SNMP traps because it’s part of the raw trap payload?
- For agent- or SNMP-polled items, is there a built-in way to include the host IP (via macro, preprocessing, or configuration)?
- Do I need to create a custom item that stores the host IP to get this information in the Kafka payload?
- More generally, what kind of item types should I use if I want host IPs to appear in the JSON message?
Comment