Product SiteDocumentation Site

7.3. Configuring Notifications via External-Agent

Requires a program (external-agent) to run when resource operations take place, and an external-recipient (IP address, email address, URI). When triggered, the external-agent is fed with dynamically filled environment variables describing precisely the cluster event that occurred. By making smart usage of these variables in your external-agent code, you can trigger any action.

Example 7.3. Configuring ClusterMon to execute an external-agent

<clone id="ClusterMon-clone">
    <primitive class="ocf" id="ClusterMon" provider="pacemaker" type="ClusterMon">
        <instance_attributes id="ClusterMon-instance_attributes">
            <nvpair id="ClusterMon-instance_attributes-user" name="user" value="root"/>
            <nvpair id="ClusterMon-instance_attributes-update" name="update" value="30"/>
            <nvpair id="ClusterMon-instance_attributes-extra_options" name="extra_options" value="-E /usr/local/bin/ -e"/>

Table 7.1. Environment Variables Passed to the External Agent

Environment Variable Description
The static external-recipient from the resource definition.
The node on which the status change happened.
The name of the resource that changed the status.
The operation that caused the status change.
The textual output relevant error code of the operation (if any) that caused the status change.
The return code of the operation.
The expected return code of the operation.
The numerical representation of the status of the operation.