News:

We really need your input in this questionnaire

Main Menu

Drbd regex miss-match

Started by aron, December 10, 2013, 08:57:46 PM

Previous topic - Next topic

aron

Hello

We are in the process of provisioning drbd and was looking to use nxagent to monitor it. It appears that the drbd status no longer matches with the expected regex strings in the agent.

I will try see if I can find the correct implementation string.

Regards

Example from: http://www.drbd.org/users-guide-8.3/s-first-time-up.html

cat /proc/drbd
version: 8.3.0 (api:88/proto:86-89)
GIT-hash: 9ba8b93e24d842f0dd3fb1f9b90e8348ddb95829 build by buildsystem@linbit, 2008-12-18 16:02:26
1: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r---
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:200768

Live from a deployment;
cat /proc/drbd
version: 8.3.11 (api:88/proto:86-96)
srcversion: 21CA73FE6D7D9C67B0C6AB2

1: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----
    ns:1081844 nr:0 dw:33336 dr:1051434 al:13 bm:64 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0

aron

       if (regcomp(&pregVersion, "version: (.*) \\(api\\:([0-9].*)\\/proto\\:([0-9\\-].*)\\)", REG_EXTENDED) != 0)
                return false;


        if (regcomp(&pregDevice, "^[[:space:]]*([0-9]+)\\: cs\\:(.*) ro\\:(.*)\\/(.*) ds\\:(.*)\\/(.*) ([A-Z]).*", REG_EXTENDED) != 0)



This works with the exception of proto:86-89 reporting that it is 86. However trying to implement [//d-] or it does not seem to get the extended value. However to a large extent it is now working.

Victor Kirhenshtein

Hi!

I've changed the drbd.cpp (protocol version should also work as expected). These changes are included in 1.2.10 release. Thank you for fixing it!

Best regards,
Victor