11.33 UXCommand

Use this Knowledge Script to run a non-interactive UNIX command in response to an event. For example, you can use this Knowledge Script to run a batch command for appending a log file or stopping a process.

You can include arguments in the command-line string, but you need to escape any double quote (") or special characters by typing a preceding backslash (\). Special characters for Perl-based scripts include the dollar sign ($), percentage (%), and at symbol (@). In addition, avoid using the ampersand (&), the dollar sign ($), or backquotes (`) in the command string.

11.33.1 Setting Parameter Values

Set the following parameter as needed:

Parameter

How to Set It

Non-interactive UNIX command

Specify the command to run. Do not enter a command that requires user input.

If your command line includes double quotes or any other special characters, use a backslash to escape the characters. For example: grep -l \"Abnormal shutdown\" applog* > /tmp/fail.

The command you enter should include all necessary arguments and handle any input and output redirection or file management required.

11.33.2 Example of How this Script Is Used

Use this Action is to create a script file that contains a series of commands to diagnose or correct problems on a server you are monitoring and have this Action launch your script file when an event is detected.

To run this Action on the managed UNIX computer, select MC (Managed Client) as the Location on the Action tab of the Properties dialog box. Also verify that the NetIQ UNIX agent account has permission to execute the command you want to run on the computer where you want the Action executed.