11.34 WriteMsgToFile

Use this Knowledge Script to write AppManager event information to a file. This file gets written to the computer that is running the action. The designation of that computer is controlled by the Action dialog when the monitoring job is created, and the options are MC (agent), MS (management server), or proxy, where proxy in turn prompts the user to designate any agent computer that is known to AppManager.

By default, the event information includes the agent computer name and the event severity level. You can select additional information to include by enabling the appropriate parameters.

You can also construct a custom message.

An event is raised when you select the custom message format but neglect to enter any text for the custom message body. Under these circumstances, the script continues to execute and uses the standard message format.

11.34.1 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

Event Notification

Event severity -- Action warning

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the WriteMsgToFile job returns a warning. The default is 35 (magenta event indicator).

Event severity -- Action failure

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the WriteMsgToFile job fails. The default is 5 (red event indicator).

Severity Configuration

Minimum event severity for Action

Set the minimum severity level, from 1 to 40, for an event that triggers this Action. The default is 1.

Maximum event severity for Action

Set the maximum severity level, from 1 to 40, for an event that triggers this Action. The default is 40.

Action

Full path to file

Provide the complete path to the file where you want to store event information or click Browse [...] to find the file. The default is c:\temp\NetiQACT_Dump.txt.

Append event information?

Select Yes to append event information to the specified file. If you do not select Yes, the log file is overwritten each time the Action runs. The default is Yes.

Number of carriage returns between messages.

Set the number of carriage returns from 0 to 20. The default value is 2.

Create folder if it does not exist?

Select Yes to create folders specified in the file path if they do not exist. The default is Yes.

Message format

Select the format you want to use for the message sent by this script:

  • Standard format generates a message based upon the selections you make from the Standard Message Options parameters.

  • Custom format generates a message based upon the subject and message body you supply in the Custom Message Options parameters.

The default is Standard.

Standard Message Options

Include date/timestamp?

Select Yes to include the date/timestamp in the standard message. The default is unselected.

Include JobID?

Select Yes to include the job ID in the standard message. The default is unselected.

Include agent computer name?

Select Yes to include the name of the agent computer in the standard message (the computer hosting the agent that initiated the Action). The default is Yes.

Include event severity?

Select Yes to include the severity of the event in the standard message. The default is Yes.

Include Knowledge Script name?

Select Yes to include the Knowledge Script name in the standard message (the Knowledge Script that initiated the Action). The default is unselected.

Include AppManager object name?

Select Yes to include the AppManager resource object name in the standard message (the AppManager resource object where the event was raised). The default is unselected.

Include AppManager event ID?

Select Yes to include the AppManager event ID in the standard message (possible only in cases when the Action is carried out by the management server). The default is unselected.

NOTE:This Knowledge Script also displays the event ID on the proxy computer.

Include event detail message?

Select Yes to include the event detail message. The default is unselected.

Custom Message Options

Custom text (can include substitutions)

Provide the text you want to include in your custom message.

You can use the keywords listed below to indicate the information you want to include in the body of your custom message. Add a space before and after keywords to ensure that the keywords display properly.

  • $ShortMsg$ (short event message)

  • $DetailMsg$ (detailed event message)

  • $Time$ (date and time of the event)

  • $JobID$ (ID of the job that raised the event)

  • $MachineName$ (name of the computer where the event was raised)

  • $Severity$ (severity of the event)

  • $KSName$ (name of the Knowledge Script that raised the event)

  • $ObjectName$ (name of the AppManager resource object where the event was raised)

  • $EventID$ (event ID)

  • $tab$ inserts four whitespace characters in the message body

  • $lf$ inserts a line feed in the message body

  • $crlf$ inserts a carriage-return line feed in the message body

  • $cr$ inserts a carriage-return in the message body

For $ShortMsg$ and $DetailMsg$ you can use number and wildcard options to indicate specific portions of the text string to include. For example:

  • $DetailMsg$[5] includes the fifth word of the detailed event message

  • $ShortMsg$[1-5] includes the first through fifth words of the short message event

  • $DetailMsg$[*5] includes the first through fifth words of the detailed event message

  • $ShortMsg$[5*] includes the fifth through last words of the short event message

If you do not enter a word specifier, AppManager returns the entire string.

The following are examples of the types of messages you can construct using these keywords:

  • Event from $MachineName$: The $ShortMsg$[1-3] has failed. The last command was $DetailMsg$[4*].

  • A severity $Severity$ event has occurred! Call the owner of $MachineName$ immediately!