[ltb-dev] [LDAP Tool Box - Bug #325] (Closed) check_ldap_syncrepl_status.pl does not correctly parse hex CSN numbers

noreply at lsc-project.org noreply at lsc-project.org
Sun Jun 12 16:16:28 CEST 2011


Issue #325 has been updated by Clément OUDOT.

Status changed from Assigned to Closed
% Done changed from 0 to 100

Done.
----------------------------------------
Bug #325: check_ldap_syncrepl_status.pl does not correctly parse hex CSN numbers
http://tools.lsc-project.org/issues/325

Author: Clément OUDOT
Status: Closed
Priority: Normal
Assigned to: Clément OUDOT
Category: Nagios plugins
Target version: nagios-plugins-0.4


André Schild reported:

According to

http://www.openldap.org/faq/index.cgi?_highlightWords=csn&file=1145

the CSN number is 3 Hex characters. (It was only two hex chars for Openldap 2.2 and 2.3 versions)

In line 323 of check_ldap_syncrepl_status.pl we look for
2-3 numbers, and not for a hex number.

Original line:
( $csn =~ m/(\d{14})\.?(\d{6})?Z#(\w{6})#(\d{2,3})#(\w{6})/g );

Changing the line to this solves the problem:
( $csn =~ m/(\d{14})\.?(\d{6})?Z#(\w{6})#(\w{2,3})#(\w{6})/g );

Okay, we just look for a-z 0-9 and _ but that should do it in that place (I'm not a perl expert)

Here a example output of a multimaster setup with 3 masters:

VERBOSE 2 ===> Found ContextCSN: 20090212103009Z#000000#00#000000
VERBOSE 2 ===> Parse 20090212103009Z#000000#00#000000 into 20090212103009 - 000000 - 00 - 000000
VERBOSE 2 ===> Found ContextCSN: 20110531084124.461932Z#000000#005#000000
VERBOSE 2 ===> Parse 20110531084124.461932Z#000000#005#000000 into 20110531084124 - 000000 - 005 - 000000
VERBOSE 2 ===> Found ContextCSN: 20100226172640.842370Z#000000#05c#000000
VERBOSE 2 ===> Parse 20100226172640.842370Z#000000#05c#000000 into 20100226172640 - 000000 - 05c - 000000
VERBOSE 2 ===> ContextCSN match with SID 05c: 20100226172640.842370Z#000000#05c#000000
VERBOSE 2 ===> Found ContextCSN: 20090212103009Z#000000#00#000000
VERBOSE 2 ===> Parse 20090212103009Z#000000#00#000000 into 20090212103009 - 000000 - 00 - 000000
VERBOSE 2 ===> Found ContextCSN: 20110531084124.461932Z#000000#005#000000
VERBOSE 2 ===> Parse 20110531084124.461932Z#000000#005#000000 into 20110531084124 - 000000 - 005 - 000000
VERBOSE 2 ===> Found ContextCSN: 20100226172640.842370Z#000000#05c#000000
VERBOSE 2 ===> Parse 20100226172640.842370Z#000000#05c#000000 into 20100226172640 - 000000 - 05c - 000000
VERBOSE 2 ===> ContextCSN match with SID 05c: 20100226172640.842370Z#000000#05c#000000
VERBOSE 2 ===> Parse 20100226172640.842370Z#000000#05c#000000 into 20100226172640 - 000000 - 05c - 000000
VERBOSE 2 ===> Parse 20100226172640.842370Z#000000#05c#000000 into 20100226172640 - 000000 - 05c - 000000


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://tools.lsc-project.org/my/account
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ltb-project.org/pipermail/ltb-dev/attachments/20110612/a3146394/attachment.htm>


More information about the ltb-dev mailing list