Here is a simple LUA script that can be ran from the NAS that will poll each hub and pull the total number of robots and probes deployed. This will create a file called nimsoft_count.txt in the Nimsoft\probes\nas directory. This is just some base code that can be modified to fit your needs.
file = io.open("nimsoft_count.txt", "w")
robots = 0
probeTotal = 0
resp,rc = nimbus.request("hub", "gethubs")
for h,hinfo in pairs(resp.hublist) do
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
probes = 0
for p,pinfo in pairs (rinfo.probelist) do
probes = probes + 1
probeTotal = probeTotal + 1
end
-- print("Number of probes on " .. rinfo.name .. " is: " .. probes)
end
robots = robots + 1
end
end
end
nimbus.session_close(sessionhandle)
end
file:write ("Total robots: " .. robots .. "\n")
print ("Total robots: " .. robots .. "\n")
print ("Total probes: " .. probeTotal .. "\n")
file:write ("Total probes: " .. probeTotal .. "\n")