mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 17:00:10 +00:00
Handles extractions from recording processes non managed by ntopng
Implements #2276
This commit is contained in:
parent
73fe73c0d9
commit
8221d14e0f
14 changed files with 145 additions and 55 deletions
|
|
@ -145,29 +145,30 @@ function dumpInterfaceStats(interface_name)
|
|||
end
|
||||
end
|
||||
|
||||
if recording_utils.isManualServiceActive(ifstats.id) then
|
||||
res["traffic_recording"] = "recording"
|
||||
elseif recording_utils.isAvailable() then
|
||||
if recording_utils.isEnabled(ifstats.id) then
|
||||
if recording_utils.isActive(ifstats.id) then
|
||||
res["traffic_recording"] = "recording"
|
||||
else
|
||||
res["traffic_recording"] = "failed"
|
||||
end
|
||||
end
|
||||
local is_manual_recording_active = recording_utils.isManualServiceActive(ifstats.id)
|
||||
if recording_utils.isAvailable() or is_manual_recording_active then
|
||||
if is_manual_recording_active then
|
||||
res["traffic_recording"] = "recording"
|
||||
elseif recording_utils.isEnabled(ifstats.id) then
|
||||
if recording_utils.isActive(ifstats.id) then
|
||||
res["traffic_recording"] = "recording"
|
||||
else
|
||||
res["traffic_recording"] = "failed"
|
||||
end
|
||||
end
|
||||
|
||||
if recording_utils.isEnabled(ifstats.id) then
|
||||
local jobs_info = recording_utils.extractionJobsInfo(ifstats.id)
|
||||
if jobs_info.ready > 0 then
|
||||
res["traffic_extraction"] = "ready"
|
||||
elseif jobs_info.total > 0 then
|
||||
res["traffic_extraction"] = jobs_info.total
|
||||
end
|
||||
res["traffic_extraction_num_tasks"] = jobs_info.total
|
||||
end
|
||||
if recording_utils.isEnabled(ifstats.id) or is_manual_recording_active then
|
||||
local jobs_info = recording_utils.extractionJobsInfo(ifstats.id)
|
||||
if jobs_info.ready > 0 then
|
||||
res["traffic_extraction"] = "ready"
|
||||
elseif jobs_info.total > 0 then
|
||||
res["traffic_extraction"] = jobs_info.total
|
||||
end
|
||||
res["traffic_extraction_num_tasks"] = jobs_info.total
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return res
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue