DX Unified Infrastructure Management

 View Only
  • 1.  Using NIS db provider with NSA

    Posted Aug 19, 2019 12:08 PM
    Edited by Emery Clark Aug 19, 2019 12:33 PM
    Hi,

    I'm getting connection timeout errors when executing lua scripts from within the NAS probe, so I have resorted to using the NSA.exe binary to run my lua scripts.

    However, I'm having trouble re-using the connection string in my lua script, and can't open a connection to my database.

    My question is, am I able to use the NIS provider with the NSA binary, and if so, are there any pre-requisites? 


    For example:

    local cs = "provider=nis;database=nis;driver=none"


  • 2.  RE: Using NIS db provider with NSA
    Best Answer

    Posted Aug 19, 2019 01:39 PM
    If you're using the nsa you need to explicitly execute the nimbus.login () call. nas does this for you automatically.

    I usually include at the beginning of my scripts something like:

    local gethubs = nimbus.request("hub","gethubs")
    if gethubs == nil then
    nimbus.login("username","passsword")
    end

    -Garin


  • 3.  RE: Using NIS db provider with NSA

    Posted Aug 19, 2019 07:37 PM
    Thanks for that tip.

    unfortunately I can't execute a nimbus.login(user, pass) because our HUB IP and DOMAIN must be specified. the login is defaulting to an IP address on another subnet.

    When I login to UIM, I specify a HUB IP and DOMAIN. without this information I cannot login.

    The same needs to be done from my script. How can I specify the HUB IP and DOMAIN to use for the nimbus.login(user,pass) function?


  • 4.  RE: Using NIS db provider with NSA

    Posted Aug 20, 2019 12:17 AM
    The Lua implementation, as I understand it, will try to find the information about the Nimbus environment without guidance. Simplistically speaking, it communicates with the robot running on the same server you are running nsa on. That should be sufficient to communicate with the UIM message bus authentication. I have been told that it is not possible to duplicate the process IM uses to log into a specific target hub. 

    So, I'll ask the question - how do you know the nimbus.login is using an IP address on another subnet? I don't recall there being any useful feedback from that function call beyond a return code. 

    Have you made sure that the server you are trying to run nsa on has a valid running robot on it?


  • 5.  RE: Using NIS db provider with NSA

    Posted Aug 20, 2019 08:35 AM
    Edited by Emery Clark Aug 20, 2019 08:45 AM


    I thought it was odd, as well. Below is a snippet of code that I'm using, followed by the output (with IP address changed). You can see that, somehow, it's printing information about the connection.

    debug-nsa.lua
    -------------------
    print("login attempt")
    local login = nimbus.login("user","password")
    if login == false then
        print("error - login failed, exiting.")
    return
    else 
    print("connected to nimbus")
    end


    output debug-nsa.lua
    ----------------------------
    PS C:\Program Files (x86)\Nimsoft\sdk\nsa\nsa.exe> .\nsa.exe .\debug-cdm.lua
    login attempt
    Aug 20 08:28:53:428 nsa: nimLogin request login failed 10.0.1.1/48000 (error)
    error - login failed, exiting.



  • 6.  RE: Using NIS db provider with NSA

    Posted Aug 20, 2019 08:47 AM
    BTW, Garin, I am successfully using the NIS connection string after logging into the nimbus. The tip about the login when using the nsa.exe was what resolved this for me. Thank you for your assistance.

    Emery