ClusterLabs / ha_cluster_exporter

Prometheus exporter for Pacemaker based Linux HA clusters
Apache License 2.0
79 stars 35 forks source link

corosync membership parsing with qdevice enabled #170

Closed efoft closed 4 years ago

efoft commented 4 years ago

Same problem as in #154 but with corosync-2.4.5-4.el7.x86_64 on CentOS 7

Jul 16 13:01:57 nfs01 ha_cluster_exporter: time="2020-07-16T13:01:57+03:00" level=warning msg="'corosync' collector scrape failed: corosync parser error: could not parse members in corosync-quorumtool output: could not find membership information"

The output of corosync-quorumtool now looks like:

Quorum information
------------------
Date:             Thu Jul 16 12:40:44 2020
Quorum provider:  corosync_votequorum
Nodes:            2
Node ID:          1
Ring ID:          1/139
Quorate:          Yes

Votequorum information
----------------------
Expected votes:   3
Highest expected: 3
Total votes:      3
Quorum:           2  
Flags:            Quorate Qdevice 

Membership information
----------------------
    Nodeid      Votes    Qdevice Name
         1          1    A,V,NMW nfs01 (local)
         2          1    A,V,NMW nfs02
         0          1            Qdevice

See 'Qdevice Name' not 'Name' in column titles under Membership information.

stefanotorresi commented 4 years ago

@efoft I guess this only applies when a Qdevice is being used? /cc @gao-yan @nick-wang

stefanotorresi commented 4 years ago

okay, so, it turns out that using the -p flag on corosync-quorumtool and adding the Qdevice column to the parser should do the trick, without worrying too much about supported corosync versions, since this is actually quite an old functionality and we should've used it from the start.

MalloZup commented 4 years ago

working on this