DX Infrastructure Manager

Expand all | Collapse all

Deactivate profile under net_connect probe using LUA script

Jump to Best Answer
  • 1.  Deactivate profile under net_connect probe using LUA script

    Posted 04-25-2017 07:06 AM

    I want to deactivate the selected profiles under net_connect probe using LUA. I am using the below script to deactivate hostname123. The script is running without any errors and after running the script restarts the net_connect probe manually. Still the profile is active under the net_connect probe. Could you please guide me on this

     

    nimbus.login("username","password")

    robot = "path to controller"
    host = "hostname123"
    print("Working on "..host)
    robot= robot..string.lower(host).."/controller"
    local args = pds.create()
    pds.putString(args, "name", "net_connect")
    pds.putString(args, "section", "/profiles/"..host)
    pds.putString(args, "key", "active")
    pds.putString(args, "value", "no")
    nimbus.request(robot, "probe_config_set", args)
    pds.delete(args)
    print("after first pds.delete")

    local args = pds.create()
    pds.putString(args, "name", "net_connect")
    pds.putString(args, "section", "/profiles/"..host)
    pds.putString(args, "key", "hostname")
    pds.putString(args, "value", host)
    nimbus.request(robot, "probe_config_set", args)
    pds.delete(args)
    print("after last pds.delete")



  • 2.  Re: Deactivate profile under net_connect probe using LUA script
    Best Answer

    Posted 04-25-2017 09:08 AM

    Hi,

     

    I think you have to review maybe the path to controller and log the nimbus.request return code

     

    local rc = nimbus.request(...) 

     

    Your PDS is okay so the problem is not here. Waiting your feedback about rc value.

     

    Best Regards,

    Thomas



  • 3.  Re: Deactivate profile under net_connect probe using LUA script

    Broadcom Employee
    Posted 04-26-2017 03:54 AM

    Hello Simjith,

     

    do you have any further questions about this thread or is it answered ?

     

    Thanks and kind regards,

    Britta Hoffner



  • 4.  Re: Deactivate profile under net_connect probe using LUA script

    Posted 04-27-2017 07:43 AM

    Hi Thomas@Tgentilhomme,

     

    Sorry for the delayed response. What you mentioned is correct, the issue was with the path to controller. Now its working fine.

     

     

    Regards

    Simjith