The blcli Delete cleanupAgent command will do this.
Thanks. That would be perfect if I could get it to work inside a job. If I run it in the CLI, this works for "server1":
blcli Delete cleanupAgent server1 10
Would it be best to run the command in an nsh script? Whatever method I use, I need to know how to use a variable for the local host.
I already tried an nsh script, setting the variable like this:
Then the command:
blcli Delete cleanupAgent $HOST 10
I ran it against a couple of clients but it failed. It seemed to try the command on the correct host, though I could be wrong.
well, this is part of the ootb cleanup script. but the above should work as well. was this a 'type 1' (runscript) or 'type 2' nsh script ?
can you show the output and errors you got ?
I don't have much experience using NSH scripts, but on the Script Options tab, I chose the first option: "Execute the script......(using runscript)". The Parameters tab is blank. The script itself is just this:
blcli Delete cleanupAgent $HOST 10
Unknown command : name space = 'Delete', command = 'cleanupAgent'.com.bladelogic.om.infra.cli.factory.CommandNotFoundException: Could not find any instance of command "Delete,cleanupAgent" with expected number of arguments: 1
Hopefully that is the information you need, but let me know.
I use run script as well. Instead of passing the target, I get it with uname. I also pass the staging dir. It may be fixed now but there used to be an issue where the command would fail if the staging dir did not exist.
Here is the script we use:
echo "$SERVER - $STAGINGDIR"
mkdir -p $STAGINGDIR
blcli Delete cleanupAgent $SERVER 30
if there are no inputs to the script then $1 will be blank. in a type 1 script, the NSH_RUNCMD_HOST will resolve to the target of the instance of the script (w/ a type 1, for each instance of the target you will get an instance of the script running).
be sure to constrain the parallelism though - type 1 + blcli calls can affect the appserver performance.
It looks like this script is to clean up the blapp server itself, not the clients.
what script ? jeremy's ?
Yes, that was in reply to Jeremy.
a type 1 will first cd to the target, so the uname should be the return of uname from the target (of that instance of the script). it looks like he's passing staging_dir as a parameter to the script as well.
Yeah, as Bill was saying, type 1 will connect to the target so the uname just gives me the name of the current server. The staging dir is passed as I was getting errors on targets that were new. Since they had not been deployed to yet, their was no staging dir and I would get a weird error.
Bill and Jeremy, thanks. It turns out that one of our Unix Admins has been working on this as well. I'll see what she has in mind and post back here if we run into any other roadblocks.
Thanks Bill, that works. It's as simple as this:
blcli Delete cleanupAgent $1 10 in a Type 1 script.
As for the parallelism, I'm going to leave it at 20, which I assume is reasonable. I want to make sure I understand that correctly. If I want to run this against a group of 200 Windows servers it will do that, but 20 at a time, right? I assume it won't stop me from running it against a group of 200 servers. (I'm used to setting this to Unlimited for the type of stuff that I normally do, but you did say that this is resource intensive on the blapp servers.)
right - parallelism just constrains how many will be targeted at once.