diff --git a/doc/Pacemaker_Explained/en-US/Ch-Alerts.txt b/doc/Pacemaker_Explained/en-US/Ch-Alerts.txt index 499b6498d7..2e89293f41 100644 --- a/doc/Pacemaker_Explained/en-US/Ch-Alerts.txt +++ b/doc/Pacemaker_Explained/en-US/Ch-Alerts.txt @@ -1,319 +1,324 @@ = Alerts = //// We prefer [[ch-alerts]], but older versions of asciidoc don't deal well with that construct for chapter headings //// anchor:ch-alerts[Chapter 7, Alerts] indexterm:[Resource,Alerts] 'Alerts' may be configured to take some external action when a cluster event occurs (node failure, resource starting or stopping, etc.). == Alert Agents == As with resource agents, the cluster calls an external program (an 'alert agent') to handle alerts. The cluster passes information about the event to the agent via environment variables. Agents can do anything desired with this information (send an e-mail, log to a file, update a monitoring system, etc.). .Simple alert configuration ===== [source,XML] ----- ----- ===== In the example above, the cluster will call +my-script.sh+ for each event. Multiple alert agents may be configured; the cluster will call all of them for each event. == Alert Recipients == Each alert may be configured with one or more recipients. The cluster will call the agent separately for each recipient. .Alert configuration with recipient ===== [source,XML] ----- ----- ===== In the above example, the cluster will call +my-script.sh+ for each event, passing the recipient +some-address+ as an environment variable. The recipient may be anything the alert agent can recognize -- an IP address, an e-mail address, a file name, whatever the particular agent supports. == Alert Meta-Attributes == As with resource agents, meta-attributes can be configured for alert agents to affect how Pacemaker calls them. .Meta-Attributes of an Alert [width="95%",cols="m,1,2 ----- ===== In the above example, the +my-script.sh+ will get called twice for each event, with each call using a 15-second timeout. One call will be passed the recipient +someuser@example.com+ and a timestamp in the format +%D %H:%M+, while the other call will be passed the recipient +otheruser@example.com+ and a timestamp in the format +%c+. == Alert Instance Attributes == As with resource agents, agent-specific configuration values may be configured as instance attributes. These will be passed to the agent as additional environment variables. The number, names and allowed values of these instance attributes are completely up to the particular agent. .Alert configuration with instance attributes ===== [source,XML] ----- ----- ===== == Using the Sample Alert Agents == -Several sample alert agents are provided in the -https://github.com/ClusterLabs/pacemaker/tree/master/extra/alerts[+extra/alerts+] -directory of the pacemaker source tree. If you installed Pacemaker via a -package, these might be available somewhere on your system, such as -+/usr/share/pacemaker+. - -While these sample scripts may be used directly as alert agents, -they are provided mainly as templates to be edited to suit your purposes. +Pacemaker provides several sample alert agents, installed in ++/usr/share/pacemaker/alerts+ by default. + +While these sample scripts may be copied and used as-is, they are provided +mainly as templates to be edited to suit your purposes. See their source code for the full set of instance attributes they support. .Sending cluster events as SNMP traps ===== [source,XML] ----- - - + + ----- ===== .Sending cluster events as e-mails ===== [source,XML] ----- - - + + ----- ===== == Writing an Alert Agent == .Environment variables passed to alert agents [width="95%",cols="m,2