Couple things here to comment on.
First, it's interesting to wrap your nimbus calls in pcall. I nave never found that necessary and I think that it is part of your issue because in doing so, you might be losing control over the data types that are passed to the function. The types of the data in the arguments to nimbus.request is critical because there's no type coercion done within nimbus.request.
Second, the calls to nimbus request take a PDS but it appears you are trying to pass a table.
From your example
pcall(nimbus.request, controller_path, "probe_config_get", {path=sqlserver_probe_path .. "/connections"})
{path=sqlserver_probe_path .. "/connections"} will be a table, not a PDS.
Here's the excerpt from the documentation on the request call
nimbus.request ( NimBUSAddress, Command, Arguments [, Wait [, ReturnAsPDS]] )
Returns the result of the command targeted for the provided nimbus component. The command-arguments are expected to be a PDS (returned by pds.create). The result is placed into a table unless the ReturnAsPDS parameter is set to true.
Please note that this is an associative table (not indexed), meaning that a PDS sections will be referenced by its section-name.
Typically your calls to nimbus.request should look something like:
local probecmd = pds.create()
pds.putInt(probecmd, "details", 0)
response, retcode = nimbus.request("/hub", "tunnel_get_info", probecmd)
pds.delete(probecmd)
And third, your call to get the probe config isn't right (unless it's doing more that I have tried in the past) - It will need these specified:
where name is the probe name (sql_response in your case), robot can be left blank, and var, if specified, needs to be the path and key name of an item in the cfg file. The password in the sql_response cfg file is going to be /connections/NAMEOFCONNECTION/password.
If you leave var blank, you will get a PDS containing a table of the entire config file.
Also, in your for loops, you can use pairs() or ipairs() - suggest using pairs instead of ipairs if only for habit because ipairs is only going to handle tables with sequential integer indexes which will generally not be the case in an arbitrary table.
And there's a function call pds.convert() which is handy to use to convert the PDS you build or get as a return to a table.
And to dump a table:
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