mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Reduce frequency of failure messages in sendTCPData
This commit is contained in:
parent
ab73418e29
commit
b7b2810e61
2 changed files with 22 additions and 5 deletions
|
|
@ -85,6 +85,7 @@ end
|
|||
-- ##############################################
|
||||
|
||||
function syslog.sendMessage(settings, notif, severity)
|
||||
local do_debug = false
|
||||
local syslog_severity = alert_consts.alertLevelToSyslogLevel(severity)
|
||||
local syslog_format = settings.syslog_alert_format
|
||||
local msg
|
||||
|
|
@ -152,11 +153,18 @@ function syslog.sendMessage(settings, notif, severity)
|
|||
msg = "<"..prio..">"..log_time.." "..host.." "..tag.."["..pid.."]: "..msg
|
||||
end
|
||||
|
||||
local success = true
|
||||
if settings.protocol == 'tcp' then
|
||||
ntop.send_tcp_data(settings.host, settings.port, msg.."\n", 1 --[[ timeout (msec) --]] )
|
||||
success = ntop.send_tcp_data(settings.host, settings.port, msg.."\n", 1 --[[ timeout (msec) --]] )
|
||||
else
|
||||
ntop.send_udp_data(settings.host, settings.port, msg)
|
||||
end
|
||||
|
||||
if not success then
|
||||
if do_debug then
|
||||
tprint("[syslog] Failure delivering message")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue