Thank you Keith! That worked perfectly. Here is the code I'm using to do this in case anyone else needs it:
--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
--tdump(pTable)
-- This function is used to easily view the table structure found in Nimsoft
-- usage would be: tdump(robot)
--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function tdump(t)
local function dmp(t, l, k)
if type(t) == "table" then
print(string.format("%s%s:", string.rep(" ", l*2), tostring(k)))
for k, v in pairs(t) do
dmp(v, l+1, k)
end
else
print(string.format("%s%s:%s", string.rep(" ", l*2), tostring(k), tostring(t)))
end
end
dmp(t, 1, "root")
end
--end tdump(pTable)-----------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
nsa_dir="E:\\Program Files (x86)\\Nimsoft\\sdk\\nsa\\"
require (nsa_dir.."library\\uim_env_vars")
--above 'require' provides uimDomain, uimHub, uimServer, uimUser, uimPW, uimInstallLoc variables.
-- Log in to NimBUS. This is mandatory for most of the processes ran in this script.
nimbusLoginResult,nimbusLoginSID = nimbus.login(uimUser,uimPW)
pSessionHandle = nimbus.session_open("/"..uimDomain.."/"..uimHub.."/"..uimServer.."/nas")
args = pds.create()
pds.putInt(args, "show_all", 1)
local alarm_list_full = {}
local cycles = 0
while true do
local alarm_list_partial,rc = nimbus.session_request(pSessionHandle, "get_alarms", args)
print("return code = "..rc)
if rc == NIME_OK then
for k,v in pairs(alarm_list_partial.alarms) do
table.insert(alarm_list_full, v)
end
elseif rc == NIME_NOENT then
print("All done in "..cycles.." requests")
break
else
print("ERROR: Got rc = "..rc..", ending loop")
break
end
cycles = cycles + 1
if cycles > 100 then
print("Too many cycles or A LOT of alarms, ending loop")
break
end
end
nimbus.session_close (pSessionHandle)
print("Total alarm count = "..#alarm_list_full)
tdump(alarm_list_full.alarms)