5.7 Triggering Corrective Actions for Events

Before you set your Knowledge Scripts to perform an action when AppManager raises an event, you should fine-tune the Knowledge Script threshold settings to determine the appropriate thresholds and actions for your environment. You don’t want to receive a high volume of e-mails or pages for events caused by thresholds that have been set too high or too low. When you’re ready to define actions for events, select a notification method: MAPI mail, SMTP mail, or a third-party paging software.

Most actions involve event notification and visibility. However, Action Knowledge Scripts can also be used to automatically correct problems. Typically, corrective actions run a command or execute SQL statements on the managed computer in response to an event. Remember that the corrective action must take place on the managed computer, not on the management server.

The Action_DosCommand, Action_DumpTran, and Action_RunSql Knowledge Scripts are good examples of Knowledge Scripts that run corrective actions.

To run a corrective action on a specific managed computer:

  1. Open the Properties dialog box for the Knowledge Script monitoring job. Click New on the Actions tab to create a new action.

  2. Select an Action Knowledge Script from the Action drop-down list. If you are monitoring a Windows computer, UNIX actions are not available.

  3. Select MC from the Location list to specify that you want AppManager to run the action on the managed computer.

    NOTE:Some actions must be run on the managed computer because they perform an operation on that computer. Other actions can be run on either the managed computer or the management server.

  4. Configure the action Type to run the first time an event is generated (a unique event), after a duplicate child event is created a specified number of times, or when the event condition no longer exists. When monitoring UNIX and Linux computers, the Type is always New Event.

  5. Select an action schedule from the Schedule drop-down list to specify the available hours during which the action can run. When monitoring UNIX and Linux computers, action schedules are not applicable.

  6. Click Properties to set the properties for the Action Knowledge Script.

    Most actions require you to set some additional properties. For example, if you select an e-mail action you need to specify an e-mail recipient. For more information about Action Knowledge Scripts and their parameters, see the AppManager Help.

  7. Click OK in the Action Properties dialog box, and then click OK in the Knowledge Script Properties dialog box.

When configuring an automated Knowledge Script action, check the following:

  • Whether the account the AppManager agent service (NetIQmc) runs under (whether LocalSystem or a specific user account) has permission to execute the desired action on the computer where the action runs.

  • Whether the action requires environment variables to be set and whether those environment variables run properly. If your action requires environment variable changes, determine whether the environment variables are instantiated by the Action Knowledge Script or are preset as system variables in the System Control Panel for the computer. For example, using Action_DosCommand to call the Attention! executable (attn.exe) requires you to set the attnsrv=servername environment variable on the computer running the action.

  • Whether the command you want to run requires user interaction, such as input. For example, if you decide to run a command to delete files, use del /Q rather than just del to ensure that any wildcard deletions take place without prompting for confirmation.