[ClusterLabs] pacemaker alerts node_selector

Reid Wahl nwahl at redhat.com
Thu Nov 26 02:25:03 EST 2020


I created https://github.com/ClusterLabs/pacemaker/pull/2241 to
correct the schema mistake.

On Wed, Nov 25, 2020 at 10:51 PM <vockinger at gmail.com> wrote:
>
> Hi, thank you for your reply.
>
> I tried it this way:
>
>     <alerts>
>       <alert id="test_alert_avzone_1" path="/usr/share/pacemaker/alerts/test_alert.sh">
>           <select>
>                 <select_nodes>hana_node_1</select_nodes>
>           </select>
>         <instance_attributes id="test_alert_1-instance_attributes">
>           <nvpair name="HANASID" value="XAI" id="test_alert_1-instance_attributes-HANASID"/>
>           <nvpair name="AVZone" value="AV1" id="test_alert_1-instance_attributes-AVZone"/>
>         </instance_attributes>
>         <recipient id="test_alert_avzone_1-recipient-1" value="/usr/share/pacemaker/alerts/test_alert.sh"/>
>       </alert>
>       <alert id="show" path="test_alert_avzone_1"/>
>     </alerts>
>
>
> During the save the select is been reset to
>   <select>
>           <select_nodes / >
>  </select>

The schema shows that <select_nodes> has to be empty.

              <element name="select">
                <interleave>
                  <optional>
                    <element name="select_attributes">
                      <zeroOrMore>
                        <element name="attribute">
                          <attribute name="id"><data type="ID"/></attribute>
                          <attribute name="name"><text/></attribute>
                        </element>
                      </zeroOrMore>
                    </element>
                  </optional>
                  <optional>
                    <element name="select_fencing">
                      <empty/>
                    </element>
                  </optional>
                  <optional>
                    <element name="select_nodes">
                      <empty/>
                    </element>
                  </optional>
                  <optional>
                    <element name="select_resources">
                      <empty/>
                    </element>
                  </optional>
                </interleave>
              </element>


> Do I need to specify in addition to select_nodes the section <element name="select_attributes">

The <select_attributes> element configures the agent to receive alerts
when a node attribute changes.

For a bit more detail on how these <select_*> values work, see:
  - https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_Explained/index.html#_alert_filters

So it doesn't seem like this would be the way to configure alerts for
a particular node, which is what you've said you want to do.

I'm not very familiar with alerts off the top of my head, so I would
have to research this further unless someone else jumps in to answer
first. However, based on a cursory reading of the doc, it looks like
the <select_*> attributes do not provide a way to filter by a
particular node. The <select_attributes> element does allow you to
filter by node **attribute**. But the <select_nodes> element simply
filters "node events" in general, rather than filtering by node.
(Anyone correct me if I'm wrong.)

>
> Thank you, Alfred
>
>
> -----Ursprüngliche Nachricht-----
> Von: Users <users-bounces at clusterlabs.org> Im Auftrag von Reid Wahl
> Gesendet: Donnerstag, 26. November 2020 05:30
> An: Cluster Labs - All topics related to open-source clustering welcomed <users at clusterlabs.org>
> Betreff: Re: [ClusterLabs] pacemaker alerts node_selector
>
> What version of Pacemaker are you using, and how does it behave?
>
> Depending on the error/misbehavior you're experiencing, this might have been me. Looks like in commit bd451763[1], I copied the alerts-2.9.rng[2] schema instead of the alerts-2.10.rng[3] schema.
>
> [1] https://github.com/ClusterLabs/pacemaker/commit/bd451763
> [2] https://github.com/ClusterLabs/pacemaker/blob/master/xml/alerts-2.9.rng
> [3] https://github.com/ClusterLabs/pacemaker/blob/master/xml/alerts-2.10.rng
>
> On Wed, Nov 25, 2020 at 9:31 AM <vockinger at gmail.com> wrote:
> >
> > Hi, I would like to trigger an external script, if something happens on a specific node.
> >
> >
> >
> > In the documentation of alerts, i can see <select_nodes /> but whatever I put into the XML, it’s not working…..
> >
> >
> >
> > configuration>
> >
> >     <alerts>
> >
> >         <alert id="my-alert" path="/path/to/my-script.sh">
> >
> >             <select>
> >
> >               <select_nodes />
> >
> >               <select_fencing />
> >
> >             </select>
> >
> >             <recipient id="my-alert-recipient1"
> > value="someuser at example.com"/>
> >
> >         </alert>
> >
> >     </alerts>
> >
> > </configuration>
> >
> > Can anybody send me an example about the right syntax ?
> >
> >
> >
> > Thank you very much……
> >
> >
> >
> > Best regards, Alfred
> >
> > _______________________________________________
> > Manage your subscription:
> > https://lists.clusterlabs.org/mailman/listinfo/users
> >
> > ClusterLabs home: https://www.clusterlabs.org/
>
>
>
> --
> Regards,
>
> Reid Wahl, RHCA
> Senior Software Maintenance Engineer, Red Hat CEE - Platform Support Delivery - ClusterHA
>
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
>
> ClusterLabs home: https://www.clusterlabs.org/
>
> _______________________________________________
> Manage your subscription:
> https://lists.clusterlabs.org/mailman/listinfo/users
>
> ClusterLabs home: https://www.clusterlabs.org/



-- 
Regards,

Reid Wahl, RHCA
Senior Software Maintenance Engineer, Red Hat
CEE - Platform Support Delivery - ClusterHA



More information about the Users mailing list