AnsweredAssumed Answered

Deactivate profile under net_connect probe using LUA script

Question asked by Simjith on Apr 25, 2017
Latest reply on Apr 27, 2017 by Simjith

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")

Outcomes