The dispatcher node determines what happens when an alert is generated:
Display the alert in Web Monitor Console.
Execute a command on a machine where an agent is running.
Notify an operator about the alert by E-mail.
Only active dispatchers handle alerts. You can have more than one type of dispatcher for each alert. For example, if two active dispatchers are set to send e-mail and execute a command for an alert, then dispatchers are executed when alert occurs
Alert has four different severity levels: DEBUG
, INFO
, WARNING
and ERROR
. ERROR
is
the highest severity level. The audit attribute
indicates whether Web Monitor saves the alert in the repository
database. If audit=true
,
the alert is saved in the database. Only alerts that you can audit
are saved in the monitoring database and displayed on the Alerts
panel.
The console element displays alerts in the agent log files. The message element is a child of the console element that defines the message the user wants to display. The printException element is a child of the console element that defines whether you want to print the stack trace in the log. You can also choose to display an exception in the XML by setting the xmlType attribute to true.
The rsh element is a child of the dispatcher element that asks a remote agent to execute a command on that machine/host. The command element is a child of the rsh element that identifies the command you want to execute when the alert occurs. The command element can also include the script name and any additional arguments.
The workingDirectory element identifies
the directory from which the command is executed. The synchronous element
defines whether command will be executed synchronously and asynchronously.
In synchronous mode, the caller waits to get the result back from
the command execution (success, exceptions). The user and password elements
contain login information to the host. The url defines
the host element and port number that the agent
is running. For example: url="rmi://localhost:9999"
.
This example demonstrates how you can setup an E-mail receiver to notify an operator an alert. Besides the appropriate E-mail ids, this example shows you how to include SMTP information, subject and description lines, and Mime Type. You can send E-mail alerts in text, HTML, and XML format.
<dispatcher> <console active="True" severity="INFO" audit="False" available=""> <message>Occurs console alert</message> <printException xmlType="False">True</printException> </console> <rsh active="False" severity="INFO" audit="False" available=""> <description>RAP Sample script test.cmd</description> <command>c:\test.cmd any arguments like Hello world!</command> <workingDirectory>c:\</workingDirectory> <synchronous>True</synchronous> <url>[host name]</url> <user>uafadmin</user> <password /> </rsh> <mail active="True" severity="INFO" audit="True" available=""> <severity>error</severity> <host>smtp.[domain name]</host> <from>[sender’s email address]</from> <to>[recipient’s email address]</to> <cc /> <bcc /> <header>key1=value1</header> <subject>RAP3.0 AppSvc - Statistic email alert v1.2</subject> <description>This sample email alert is generated from RAP application services and is intended for internal use only. This code can be customized by users for each exception. below the exception content as HTML.</description> <mimeType>text/html</mimeType> </mail> </dispatcher>