(imported comment written by Tim.Rice)
I’m going to tackle the concept a little differently that you seem to lay it out. Rather than download a file and then edit it, I’m going to recommend you build the file on the fly, and replace the HOSTNAME in the appropriate line(s) as the file is created.
The concept is fairly simple.
If you insist that this be a FIXLET, then we need to first determine a relevance clause that will differentiate between the file you WANT to deposit, and the one that is ALREADY there. For a Fixlet to return a Status of Fixed, the relevance clause must evaluate to TRUE before the Fixlet runs, and FALSE after it runs. That’s a bit more than I want to tackle here.
To keep this simple, I recommend using a TASK to perform what you want to do.
To take your request, literally …
- In the Console, select the ALL CONTENT domain (lower left corner of the Console).
- From the Tools menu choose CREATE NEW TASK …
- Give your new Task a descriptive name and briefly describe what it is going to do.
- Click on the RELEVANCE tab
- We’re going to limit this task to only running on Windows machines that seem to have TSM installed (based on the folder being there).
- Choose the third radio button, and we’ll enter some Relevance clauses to limit the targeting for the Task.
- Enter ((Name of Operating System as lowercase) starts with “win”)
- Click the [+] to the right of the clause to add a second relevance clause to the Task. These clauses will be joined together with AND when evaluated by the clients.
- Enter (Exists folder “C:\Program Files\Tivoli\tsm\baclient”)
- This clause will ensure that the destination folder exists and that TSM looks like it’s installed. To really tell if TSM is really installed would take a more complicated clause, and I’m at home with no access to test a clause like that right now.
- Now click on the ACTIONS tab and we’ll start on the meat of the Task.
- Enter the following text into the Action (flushing out your dms.opt file contents between the createfile and ##END## lines)
// We’re going to use the Parameter command to simplify this a little.
parameter “Host” = “{Computer Name}”
//We are going to build the new file “on the fly” and insert the Parameter we created above.
//Be sure that there is not already a __createfile file or we could get an error, and the Task would abort.
delete __createfile
//“createfile until” will do exactly what it says. It will add each line to __createfile until we get to the specified line.
//Anywhere you want to insert the name of the computer, use the text {Parameter “Host”}
//The curly brackets tell the Agent, to treat the text between them as “Relevance” and replace the text with the results.
//In this case, the Parameter command at the top of the action will set the “Host” Parameter equal to the name of the computer running the action.
//You could simply use {Computer Name}
//If the File you are trying to build contains a left hand curly bracket, you will need to “Escape” it by doubling it. You don’t need
//to double the right hand or closing curly brackets.
createfile until ##END##
- dsm.opt for the Microsoft Windows Backup-Archive Client
ssw**************************************************************
Exclude “*:\macintosh volume*”
Exclude “*:\macintosh volume…*”
Exclude “*:\microsoft uam volume…*”
…
… (put the contents of your dms.opt file here placing {Parameter “Host”} anywhere you want the computer name to be inserted.
…
nodename {Parameter “Host”}
…
…
##END##
//Now we have the file created and need to move it into place
//First we delete the original if it exists
if {exists file “C:\Program Files\Tivoli\tsm\baclient\dsm.opt”}
delete “C:\Program Files\Tivoli\tsm\baclient\dsm.opt”
endif
move __createfile “C:\Program Files\Tivoli\tsm\baclient\dsm.opt”
OK, that should do it. BEFORE you save your new Task, look in the upper right corner of the dialog box. Be sure that you are saving the Task in the Site you intend. By default, unless you are a Master Operator, it will save it in your Personal Site. This means that nobody else, other than a Master Operator will be able to see the new Task. If you need to change it, do so now then click the OK button and save your new Task.
Give it a few minutes and Windows machines with TSM installed should start to report as Relevant to the Task.
Targeting any of these machines with the Task will create your new file with the Target computers name inserted where ever you put the {Parameter “Host”} string.
NOTE: To cover my posterior and yours, I STRONGLY suggest you create the TSM folder path on your workstation, let your machine report to the task, and test the Task against YOUR computer rather than a production system to ensure that I got this right, and that everything works properly.
With a little more work, it would be possible to modify the Task so that no matter where TSM was installed, the dsm.opt file could be built correctly, including all the path names for logs, etc. This task will only update TSM installed in the default location. Hint: It might involve creating a “Path” parameter that looked for the Install Path in the registry.
If testing reveals any problems with the task, or you have other questions, I’ll be happy to help, within reason