Skip to content

Commit

Permalink
Rename active agent port to listen port (zabbix.agent.listenport)
Browse files Browse the repository at this point in the history
  • Loading branch information
markkuleinio committed Jul 26, 2022
1 parent d1564db commit fd22d98
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions zabbix.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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,
}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fd22d98

Please sign in to comment.