>>> Ken Gaillot <kgail...@redhat.com> schrieb am 25.02.2021 um 18:43 in Nachricht <1ae046f0c3270e5c89a3b6367a3c7255bc6c1eea.ca...@redhat.com>: > I think crm_mon can do nearly all of that: > > * ‑‑daemonize: run continuously in the background > * ‑‑output‑as: html or xml (or text with the upcoming 2.1.0 release) > * ‑‑output‑to: any file name > * ‑‑include/‑‑exclude: limit what sections are displayed, if desired > (with recent releases) > * ‑‑resource: limit resource displays to a specific resource, or a > specific set of resources that have been tagged in the CIB (with 2.0.5) > > The XML output will give an abundance of information, for example about > DC and quorum: > > <current_dc present="true" > version="2.0.5‑141.2a2d6501b.git.el8‑2a2d6501b" > name="rhel8‑3" id="3" with_quorum="true"/> > > and about each node: > > <node name="cluster01" id="1" online="true" > standby="false" standby_onfail="false" > maintenance="false" pending="false" unclean="false" > shutdown="false" expected_up="true" is_dc="false" > resources_running="7" type="member"/> >
Yes it's all in the CIB, but parsing XML is not being considered efficient by me ;-) In most cases using XML just speeds up global warming ;-) Regards, Ulrich > > > On Thu, 2021‑02‑25 at 11:26 +0100, Ulrich Windl wrote: >> Thanks, >> >> I had been expecting some magic user‑level command to be used. C >> programming is probably efficient, but I#ll have to write another >> tool first. >> >> It seems the corosync‑quorumtool can also provide the information. >> Is it correct that the "ring id" has the node id of the DC? >> Like here (node id 116 is the DC): >> ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ >> Date: Thu Feb 25 11:24:08 2021 >> Quorum provider: corosync_votequorum >> Nodes: 3 >> Node ID: 119 >> Ring ID: 116/42660 >> Quorate: Yes >> >> Regards, >> Ulrich >> >> > > > Christine Caulfield <ccaul...@redhat.com> schrieb am 25.02.2021 >> > > > um 08:22 in >> >> Nachricht <52d91afa‑9b89‑4e2e‑4663‑b1ded39a0...@redhat.com>: >> > The most efficient way of getting corosync facts about nodes/quorum >> > is >> > to use the votequorum API. >> > >> > see /usr/include/corosync/votequorum.h >> > and in the corosync sources tarball tests/testvotequorum1.c >> > >> > CHrissie >> > >> > >> > On 25/02/2021 07:16, Ulrich Windl wrote: >> > > Hi! >> > > >> > > I'm thinking about some simple cluster status display that is >> > > updated >> > >> > periodically. >> > > I wonder how to get some "cluster facts" efficiently. Among those >> > > are: >> > > >> > > * Is corosync running, and how many nodes can be seen? >> > > * Is Pacemaker running, how many nodes does it see, and does it >> > > have a >> > >> > quorum? >> > > * Is the current node DC? >> > > * How many resources matching some regular expression are >> > > running? >> > > >> > > Regards, >> > > Ulrich > ‑‑ > Ken Gaillot <kgail...@redhat.com> > > _______________________________________________ > 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/