mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 16:09:32 +00:00
Initial import from SVN
This commit is contained in:
parent
1601f6bbf2
commit
730d76b9f5
1612 changed files with 715104 additions and 0 deletions
69
scripts/lua/sprobe_host_process.lua
Normal file
69
scripts/lua/sprobe_host_process.lua
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
--
|
||||
-- (C) 2014-15-15 - ntop.org
|
||||
--
|
||||
|
||||
dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
|
||||
require "lua_utils"
|
||||
|
||||
host_ip = _GET["host"]
|
||||
host_name = _GET["name"]
|
||||
host_id = _GET["id"]
|
||||
|
||||
if(mode ~= "embed") then
|
||||
sendHTTPHeader('text/html; charset=iso-8859-1')
|
||||
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
|
||||
active_page = "hosts"
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
|
||||
end
|
||||
|
||||
print("<hr><h2><A HREF="..ntop.getHttpPrefix().."/lua/host_details.lua?host="..host_ip..">"..host_name.."</A> Processes Interaction</H2>")
|
||||
|
||||
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/sprobe_process_header.inc")
|
||||
|
||||
print('d3.json("'..ntop.getHttpPrefix()..'/lua/sprobe_host_process_data.lua?host='..host_ip..'&id='..host_id..'",')
|
||||
|
||||
|
||||
print [[
|
||||
function(error, json) {
|
||||
if (error) return console.warn(error);
|
||||
links = json;
|
||||
|
||||
// Compute the distinct nodes from the links.
|
||||
links.forEach(function(link) {
|
||||
if(link.source_pid == -1) {
|
||||
/* IP Address -> PID */
|
||||
_link = "]]
|
||||
print (ntop.getHttpPrefix())
|
||||
print [[/lua/sprobe_host_process.lua?host="+link.source+"&name="+link.source_name+"&id=0";
|
||||
} else {
|
||||
/* PID -> IP Address */
|
||||
_link = "]]
|
||||
print (ntop.getHttpPrefix())
|
||||
print [[/lua/get_process_info.lua?pid="+link.source_pid+"&name="+link.source_name+"&host=]] print(host_ip) print [[&page=Flows";
|
||||
}
|
||||
link.source = nodes[link.source] || (nodes[link.source] = {name: link.source_name, num:link.source, link: _link, type: link.source_type, pid: link.source_pid });
|
||||
|
||||
if(link.target_pid == -1) {
|
||||
/* IP Address -> PID */
|
||||
_link = "]]
|
||||
print (ntop.getHttpPrefix())
|
||||
print [[/lua/sprobe_host_process.lua?host="+link.target+"&name="+link.target_name+"&id=0";
|
||||
} else {
|
||||
/* PID -> IP Address */
|
||||
_link = "]]
|
||||
print (ntop.getHttpPrefix())
|
||||
print [[/lua/get_process_info.lua?pid="+link.target_pid+"&name="+link.target_name+"&host=]] print(host_ip) print [[&page=Flows";
|
||||
}
|
||||
|
||||
link.target = nodes[link.target] || (nodes[link.target] = {name: link.target_name, num: link.target, link: _link, type: link.target_type, pid: link.target_pid });
|
||||
});
|
||||
|
||||
]]
|
||||
|
||||
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/sprobe_process.inc")
|
||||
|
||||
if(mode ~= "embed") then
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue