ClusterLabs / ha_cluster_exporter

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

regexp parsing corosync-cfgtool output will not work #215

Closed linuxnase closed 1 year ago

linuxnase commented 1 year ago

In collector/corosync/parser.go line 154 There is a bug in the regexp when parsing corosync-cfgtool -s output: re := regexp.MustCompile(`(?m)(?P<prefix>RING|Link) ID (?P<number>\d+)\s+(?P<id>id|addr) \s*= (?P<address>.+)\s+status \s*= (?P<status>.+)`) corosync-cfgtool outputs a tab character after "id" and "status", so the regexp with an additional space after id/status will not match. Without the spaces in front of "\s" the regexp will work. ...(?P<id>id|addr)\s*= (?P<address>.+)\s+status\s*=...

stefanotorresi commented 1 year ago

hey, thanks for reporting this! It should now be fixed, could you please confirm that by building from the latest sources?

linuxnase commented 1 year ago

Hi Stefano, problem solved :thumbsup: