mirror of
https://github.com/nmap/nmap.git
synced 2026-06-25 18:48:19 +00:00
Make flume-master-info output nothing if it finds no page matches.
This commit is contained in:
parent
1493e74f63
commit
5edcec7a9a
1 changed files with 13 additions and 7 deletions
|
|
@ -167,7 +167,6 @@ action = function( host, port )
|
|||
stdnse.print_debug(1, ("%s: ServerID %s"):format(SCRIPT_NAME,upgrades))
|
||||
result[#result] = ("ServerID: %s"):format(upgrades)
|
||||
end
|
||||
table.insert(result, "Flume nodes:")
|
||||
for logical,physical,hostname in string.gmatch(body,"<tr><td>([%w%.-_:]+)</td><td>([%w%.]+)</td><td>([%w%.]+)</td>") do
|
||||
stdnse.print_debug(2, ("%s: %s (%s) %s"):format(SCRIPT_NAME,physical,logical,hostname))
|
||||
if (table_count(nodes, hostname) == 0) then
|
||||
|
|
@ -176,9 +175,9 @@ action = function( host, port )
|
|||
end
|
||||
end
|
||||
if next(nodes) ~= nil then
|
||||
table.insert(result, "Flume nodes:")
|
||||
result[#result+1] = nodes
|
||||
end
|
||||
result[#result+1] = "Zookeeper Master:"
|
||||
for zookeeper in string.gmatch(body,"Dhbase.zookeeper.quorum=([^][\"]+)") do
|
||||
if (table_count(zookeepers, zookeeper) == 0) then
|
||||
zookeepers[#zookeepers+1] = zookeeper
|
||||
|
|
@ -186,9 +185,9 @@ action = function( host, port )
|
|||
end
|
||||
end
|
||||
if next(zookeepers) ~= nil then
|
||||
result[#result+1] = "Zookeeper Master:"
|
||||
result[#result+1] = zookeepers
|
||||
end
|
||||
result[#result+1] = "Hbase Master Master:"
|
||||
for hbasemaster in string.gmatch(body,"Dhbase.rootdir=([^][\"]+)") do
|
||||
if (table_count(hbasemasters, hbasemaster) == 0) then
|
||||
hbasemasters[#hbasemasters+1] = hbasemaster
|
||||
|
|
@ -196,12 +195,19 @@ action = function( host, port )
|
|||
end
|
||||
end
|
||||
if next(hbasemasters) ~= nil then
|
||||
result[#result+1] = "Hbase Master Master:"
|
||||
result[#result+1] = hbasemasters
|
||||
end
|
||||
result[#result+1] = "Enviroment: "
|
||||
result[#result+1] = parse_page(host, port, env_uri, env_keys )
|
||||
result[#result+1] = "Config: "
|
||||
result[#result+1] = parse_page(host, port, config_uri, config_keys )
|
||||
local vars = parse_page(host, port, env_uri, env_keys )
|
||||
if next(vars) ~= nil then
|
||||
result[#result+1] = "Enviroment: "
|
||||
result[#result+1] = vars
|
||||
end
|
||||
local vars = parse_page(host, port, config_uri, config_keys )
|
||||
if next(vars) ~= nil then
|
||||
result[#result+1] = "Config: "
|
||||
result[#result+1] = vars
|
||||
end
|
||||
nmap.set_port_version(host, port)
|
||||
return stdnse.format_output(true, result)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue