Ok, this will need a slight modification to run outside the NAS, wasn't paying attention to the script earlier.
You will need to change the hub variable in line 2 to your Primary hub address and change the username and password in line one.
Save the file with a .lua extension and save it into the Nimsoft/sdk/nsa folder and then open a command probe from that directory and run nsa filename.lua
nimbus.login("username","password")
hub = "/Domain/Hub/Robot/hub"
domain = "Domain"
local hosts = {}
z = 1
-- This block will get all the probes running interface_traffic
resp,rc = nimbus.request(hub, "gethubs")
for h,hinfo in pairs(resp.hublist) do
if hinfo.domain == domain then
local args = pds.create()
pds.putInt(args, "detail", 1)
sessionhandle = nimbus.session_open(hinfo.addr)
if sessionhandle ~= nil then
local r_resp,rc = nimbus.session_request(sessionhandle, "getrobots", args, 300)
if rc == 0 then
for r,rinfo in pairs(r_resp.robotlist) do
if rinfo.probelist ~= nil then
for p,pinfo in pairs (rinfo.probelist) do
if pinfo.name == "interface_traffic" then
--print("Found interface_traffic probe at " .. rinfo.addr)
hosts[z] = rinfo.addr
z = z + 1
end
end
end
end
end
end
nimbus.session_close(sessionhandle)
end
end
--This block will retreive all the devices on each interface_traffic probe
for i,hostinfo in ipairs(hosts) do
host = hostinfo .. "/interface_traffic"
local result,rc = nimbus.request(host, "get_profile_status", "", 300)
if rc == 0 then
if result.Profiles ~= nil then
for i, agentinfo in pairs(result.Profiles) do
if agentinfo.Interfaces ~= nil then
for j, interface in pairs(agentinfo.Interfaces) do
print (hostinfo..","..agentinfo.profile_name..","..interface.name)
end
end
end
end
end
end