From fd22d982b6f56e614b0deb79b8cc42f7948b8d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markku=20Leini=C3=B6?= Date: Tue, 26 Jul 2022 22:16:05 +0300 Subject: [PATCH] Rename active agent port to listen port (zabbix.agent.listenport) --- zabbix.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zabbix.lua b/zabbix.lua index 284a1e4..f1f5b0a 100644 --- a/zabbix.lua +++ b/zabbix.lua @@ -1,4 +1,4 @@ -local VERSION = "2022-07-26.1" +local VERSION = "2022-07-26.2" local zabbix_protocol = Proto("Zabbix", "Zabbix Protocol") -- for some reason the protocol name is shown in UPPERCASE in Protocol column -- (and in Proto.name), so let's define a string to override that @@ -30,7 +30,7 @@ local p_agent_name = ProtoField.string("zabbix.agent.name", "Agent Name", base.A local p_agent_hostmetadata = ProtoField.string("zabbix.agent.hostmetadata", "Agent Host Metadata", base.ASCII) local p_agent_hostinterface = ProtoField.string("zabbix.agent.hostinterface", "Agent Host Interface", base.ASCII) local p_agent_listenip = ProtoField.string("zabbix.agent.listenip", "Agent Listen IP", base.ASCII) -local p_agent_port = ProtoField.uint16("zabbix.agent.port", "Agent Port") +local p_agent_listenport = ProtoField.uint16("zabbix.agent.listenport", "Agent Listen Port") local p_agent_checks = ProtoField.bool("zabbix.agent.activechecks", "Agent Active Checks") local p_agent_data = ProtoField.bool("zabbix.agent.data", "Agent Data") local p_agent_heartbeatfreq = ProtoField.uint16("zabbix.agent.heartbeatfreq", "Agent Heartbeat Frequency") @@ -48,7 +48,7 @@ zabbix_protocol.fields = { p_large_length, p_large_reserved, p_large_uncompressed_length, p_data, p_data_len, p_success, p_failed, p_response, p_version, p_session, p_agent, p_agent_name, p_agent_checks, p_agent_data, p_agent_heartbeatfreq, - p_agent_hostmetadata, p_agent_hostinterface, p_agent_listenip, p_agent_port, + p_agent_hostmetadata, p_agent_hostinterface, p_agent_listenip, p_agent_listenport, p_proxy, p_proxy_name, p_proxy_heartbeat, p_proxy_data, p_proxy_config, p_proxy_response, p_time, } @@ -151,7 +151,7 @@ local function doDissect(buffer, pktinfo, tree) local agent_hostmetadata = nil local agent_hostinterface = nil local agent_listenip = nil - local agent_port = nil + local agent_listenport = nil local proxy_name = nil local version = nil local session = nil @@ -175,7 +175,7 @@ local function doDissect(buffer, pktinfo, tree) agent_hostmetadata = string.match(data_str, '"host_metadata":"(.-)"') agent_hostinterface = string.match(data_str, '"interface":"(.-)"') agent_listenip = string.match(data_str, '"ip":"(.-)"') - agent_port = string.match(data_str, '"port":([0-9]*)') + agent_listenport = string.match(data_str, '"port":([0-9]*)') elseif string.find(data_str, '{"request":"agent data",') then -- active agent sending data agent = true @@ -413,8 +413,8 @@ local function doDissect(buffer, pktinfo, tree) if agent_listenip then subtree:add(p_agent_listenip, agent_listenip) end - if agent_port then - subtree:add(p_agent_port, agent_port) + if agent_listenport then + subtree:add(p_agent_listenport, agent_listenport) end if agent_heartbeat_freq then subtree:add(p_agent_heartbeatfreq, agent_heartbeat_freq)