In this procedure you upload an existing executable as a Pre-Action or Post-Action to the knowledge base. You can create a category under Pre-Actions or Post-Actions before uploading an action (see Adding Categories).
Log in with full permissions or as the admin user.
From the drop-down list in the tool bar, select a distribution-architecture.
The Components list shows Local components applied to the selected distribution.
From the Components list select Local/Post-Actions | Pre-Actions/[category].
Do one of the following:
From the tool bar, click the Add Component button.
Right-click the selected category and choose Local -> Add.
From the Components menu, choose Local -> Add.
The Add Post Action or the Add Pre Action window opens.
Type a name for the component that will point to your Post-action or Pre-action. This should not be the complete file name. The name should be a name that is easily understood.
Type a free-text description.
Check each distribution to which this file should be applied.
Select a source machine:
If the console has access to the file, select Console.
If a remote managed host has access to the file, select Managed Host.
Remote upload is limited to 5 Mbytes. Console upload is unlimited. It is recommended that you upload from the console whenever possible.
If you selected console, follow this procedure. If you selected Managed Host, go to To Upload a Post-action or a Pre-action from a Managed Host.
Click the Select File button of the File Name field. The Choose File window opens.
Browse to and select the relevant file.
Click Open.
The Choose File window closes, and the path name appears in the File Name field of the Add Pre Action or Add Post Action window.
Click Apply.
The Status column indicates when the upload is done.
Click Close to close the window, or Reset to add more.
If you selected Managed Host, follow this procedure.
Click the Select Host button of the Host Name field.
The Host Selection window opens.
Select the managed host that has the file, and click OK.
The Host Selection window closes. The host name appears in the Host Name field of the Add Pre Action or Add Post Action window.
In the File Name field, type the full path name of the file.
Click Apply.
The Status column indicates when the upload is done. Click Close to close the window, or Reset to add more.
The Add Target Local command is the same for Pre-actions, Post-actions, Configuration files, Macros, and Probes. The following syntax is for Pre-actions and Post-actions. The -tP parameter is for Pre-actions; -tS is for Post-actions. The example script adds a Post-action.
In the CLI syntax, a category under the default Local categories is mandatory. See the procedure: Example 5–1 on for the Add Local Category CLI command. See Add Target Local (-atl) Command.
#! /bin/bash
function login {
echo -n “Type your user name:”
read user
echo -n “Type your password:”
read password
}
function distro {
echo “Active distributions are:”
uce_cli -ld -u “$user” -p “$password”
echo -n “To which distro should this script be added?”
read distro
echo
}
function category {
echo “Under which category should this Post-action be added?”
echo “Valid answers: any subcategory under Post-actions. See list:”
uce_cli -fc -T “Post-actions” -sons -D $distro -u “$user” -p “$password” #> tmp.file
sed “s/ROOT\/Local\/Post-actions//” tmp.file
echo -n “Start your answer with / :”
read parent #rm tmp.file
echo
}
function setup {
echo -n “Type the full path name of the file to upload:”
read pathname
echo -n “Type a display name for the local file:”
read displayName
}
login
distro
category
setup
uce_cli -atl -f “$pathname” -pT “Post-actions$parent” -tS “$displayName” -D $distro -u “$user” -p “$password”
|