I want to apply *.cfx files (that I create via a script) to a probe (logmon specifically, but would like to be able to do this generally).
CA support has no clue how to do this and thinks it is impossible. Anyone know a way?
If you've created the logmon.cfg (from the logmon.cfx) via a script, then you just need to push the file to the robot, to the relevant probe directory overwriting the existing cfg and restart the probe (or robot which is probably easier).
I know you can do this with a lua script and with other languages as well using the nimbus api.
What is your language of choice?
Thanks, Rowan.I have created the logmon.cfx file via shell script, based on the contents of certain application files on each server, and want to use it to update the existing logmon.cfg file in a manner similar to what happens when a package is pushed via IM. Currently, I create the cfx file via a shell script. Do you have an example LUA script you can share?
I don't unfortunately but in lua you would have to create the package using a callback to the distsrv and then distribute the package using the job_add callback.
Alternatively if you can create the whole cfg file (not just the updated keys) then you could use the controller callbacks text_file_put to push the file to the robot and restart the probe.
Just some ideas…
Since I want to do this based on files on the robot itself, distsrv would probably be more trouble than it is work.What would happen if I use text_file_put to push a cfx file? Would it just copy the file and ignore its presence?
If you generate the full cfx file, why not replacing the existing cfg file and restarting the probe?
I'd suggest doing this in LUA - you have more control but you could do it using shell script. My examples will be from LUA so take that into account
To get the contents of the config file you'd use a callback to the controller like:
local probecmd = pds.create() pds.putString(probecmd, "name", "cdm") response, retcode = nimbus.request(RobotPath .. "/controller", "probe_config_get", probecmd)
This will allow you to use the response table to determine if you need to do whatever it is that you are doing.
To make changes you do something like:
local options = pds.create() pds.putString(options, "/disk/ignore_filesystem", "/.*snap.*/")
local args = pds.create() pds.putString(args, "name", "cdm") pds.putPDS(args, "as_pds", options) local resp,rc = nimbus.request(RobotPath.. "/controller", "probe_config_set", args) pds.delete(args)
Then restart to put into effect:
output2,return_status2 = nimbus.request ( RobotPath .. "/cdm", "_restart" )