mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Implemented local hosts looking glass (more criteria to be added)
This commit is contained in:
parent
8263c1c65a
commit
091378fd7b
13 changed files with 412 additions and 55 deletions
|
|
@ -57,6 +57,9 @@ interface.select(ifname)
|
|||
|
||||
host_info = url2hostinfo(_GET)
|
||||
|
||||
criteria = _GET["criteria"]
|
||||
if(criteria == nil) then criteria = "" end
|
||||
|
||||
interface.select(ifname)
|
||||
|
||||
if(host_info["host"] ~= nil) then
|
||||
|
|
@ -79,9 +82,16 @@ else
|
|||
-- Get from redis the throughput type bps or pps
|
||||
throughput_type = getThroughputType()
|
||||
|
||||
--tprint(host)
|
||||
|
||||
print("\"column_since\" : \"" .. secondsToTime(now-host["seen.first"]+1) .. "\", ")
|
||||
print("\"column_last\" : \"" .. secondsToTime(now-host["seen.last"]+1) .. "\", ")
|
||||
print("\"column_traffic\" : \"" .. bytesToSize(host["bytes.sent"]+host["bytes.rcvd"]).. "\", ")
|
||||
|
||||
label, fnctn = label2criteriakey(criteria)
|
||||
|
||||
c = host.criteria
|
||||
print("\"column_"..criteria.."\" : \"" .. fnctn(c[label]).. "\", ")
|
||||
|
||||
if((host["throughput_trend_"..throughput_type] ~= nil)
|
||||
and (host["throughput_trend_"..throughput_type] > 0)) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue