Update README and comments
This commit is contained in:
parent
d19d121843
commit
d9ac73473d
2 changed files with 43 additions and 37 deletions
56
README.md
56
README.md
|
@ -25,18 +25,26 @@ A single couple of DN and password able to connect to both server and without re
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
```
|
```
|
||||||
Usage: check_syncrepl_extended [options]
|
usage: check_syncrepl_extended [-h] [-v] [-p PROVIDER] [-c CONSUMER]
|
||||||
|
[-i SERVERID] [-T] [-D DN] [-P PWD] [-b BASEDN]
|
||||||
|
[-f FILTERSTR] [-d] [-n] [-q]
|
||||||
|
[--no-check-certificate]
|
||||||
|
[--no-check-contextCSN] [-a]
|
||||||
|
[--exclude-attributes EXCL_ATTRS]
|
||||||
|
[--touch TOUCH] [--replace-touch]
|
||||||
|
[--remove-touch-value] [--page-size PAGE_SIZE]
|
||||||
|
|
||||||
Options:
|
Script to check LDAP syncrepl replication state between two servers.
|
||||||
--version show program's version number and exit
|
|
||||||
|
optional arguments:
|
||||||
-h, --help show this help message and exit
|
-h, --help show this help message and exit
|
||||||
-p PROVIDER, --provider=PROVIDER
|
-v, --version show program's version number and exit
|
||||||
|
-p PROVIDER, --provider PROVIDER
|
||||||
LDAP provider URI (example:
|
LDAP provider URI (example:
|
||||||
ldaps://ldapmaster.foo:636)
|
ldaps://ldapmaster.foo:636)
|
||||||
-c CONSUMER, --consumer=CONSUMER
|
-c CONSUMER, --consumer CONSUMER
|
||||||
LDAP consumer URI (example :
|
LDAP consumer URI (example: ldaps://ldapslave.foo:636)
|
||||||
ldaps://ldapslave.foo:636)
|
-i SERVERID, --serverID SERVERID
|
||||||
-i SERVERID, --serverID=SERVERID
|
|
||||||
Compare contextCSN of a specific master. Useful in
|
Compare contextCSN of a specific master. Useful in
|
||||||
MultiMaster setups where each master has a unique ID
|
MultiMaster setups where each master has a unique ID
|
||||||
and a contextCSN for each replicated master exists. A
|
and a contextCSN for each replicated master exists. A
|
||||||
|
@ -44,12 +52,12 @@ Options:
|
||||||
(limited to 3 hex digits, example: '12' compares the
|
(limited to 3 hex digits, example: '12' compares the
|
||||||
contextCSN matching '#00C#')
|
contextCSN matching '#00C#')
|
||||||
-T, --starttls Start TLS on LDAP provider/consumers connections
|
-T, --starttls Start TLS on LDAP provider/consumers connections
|
||||||
-D DN, --dn=DN LDAP bind DN (example :
|
-D DN, --dn DN LDAP bind DN (example:
|
||||||
uid=nagios,ou=sysaccounts,o=example
|
uid=nagios,ou=sysaccounts,o=example
|
||||||
-P PWD, --pwd=PWD LDAP bind password
|
-P PWD, --pwd PWD LDAP bind password
|
||||||
-b BASEDN, --basedn=BASEDN
|
-b BASEDN, --basedn BASEDN
|
||||||
LDAP base DN (example: o=example)
|
LDAP base DN (example: o=example)
|
||||||
-f FILTER, --filter=FILTER
|
-f FILTERSTR, --filter FILTERSTR
|
||||||
LDAP filter (default: (objectClass=*))
|
LDAP filter (default: (objectClass=*))
|
||||||
-d, --debug Debug mode
|
-d, --debug Debug mode
|
||||||
-n, --nagios Nagios check plugin mode
|
-n, --nagios Nagios check plugin mode
|
||||||
|
@ -58,20 +66,23 @@ Options:
|
||||||
Don't check the server certificate (Default: False)
|
Don't check the server certificate (Default: False)
|
||||||
--no-check-contextCSN
|
--no-check-contextCSN
|
||||||
Don't check servers contextCSN (Default: False)
|
Don't check servers contextCSN (Default: False)
|
||||||
-a, --attributes Check attributes values (Default : check only
|
-a, --attributes Check attributes values (Default: check only entryCSN)
|
||||||
entryCSN)
|
--exclude-attributes EXCL_ATTRS
|
||||||
--exclude-attributes=EXCL_ATTRS
|
|
||||||
Don't check this attribut (only in attribute check
|
Don't check this attribut (only in attribute check
|
||||||
mode)
|
mode)
|
||||||
--touch=TOUCH Touch attribute giving in parameter to force resync a
|
--touch TOUCH Touch attribute giving in parameter to force resync a
|
||||||
this LDAP object from provider. A value '%%TOUCH%%'
|
this LDAP object from provider. A value '%TOUCH%' will
|
||||||
will be add to this attribute and remove after. The
|
be add to this attribute and remove after. The user
|
||||||
user use to connect to the LDAP directory must have
|
use to connect to the LDAP directory must have write
|
||||||
write permission on this attribute on each object.
|
permission on this attribute on each object.
|
||||||
--replace-touch In touch mode, replace value instead of adding.
|
--replace-touch In touch mode, replace value instead of adding.
|
||||||
--page-size=PAGE_SIZE
|
--remove-touch-value In touch mode, remove touch value if present.
|
||||||
|
--page-size PAGE_SIZE
|
||||||
Page size: if defined, paging control using LDAP v3
|
Page size: if defined, paging control using LDAP v3
|
||||||
extended control will be enabled.
|
extended control will be enabled.
|
||||||
|
|
||||||
|
Author: Benjamin Renard <brenard@easter-eggs.com>, Source:
|
||||||
|
https://gogs.zionetrix.net/bn8/check_syncrepl_extended
|
||||||
```
|
```
|
||||||
|
|
||||||
Copyright
|
Copyright
|
||||||
|
@ -82,9 +93,8 @@ Copyright (c) 2017 Benjamin Renard
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
|
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,7 @@
|
||||||
# and without restriction to retrieve objects from servers.
|
# and without restriction to retrieve objects from servers.
|
||||||
#
|
#
|
||||||
# Author: Benjamin Renard <brenard@easter-eggs.com>
|
# Author: Benjamin Renard <brenard@easter-eggs.com>
|
||||||
# Date: Mon, 10 Dec 2012 18:04:24 +0100
|
# Source: https://gogs.zionetrix.net/bn8/check_syncrepl_extended
|
||||||
# Source: http://git.zionetrix.net/check_syncrepl_extended
|
|
||||||
#
|
#
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
@ -49,12 +48,9 @@ import ldap.modlist as modlist
|
||||||
TOUCH_VALUE = '%%TOUCH%%'
|
TOUCH_VALUE = '%%TOUCH%%'
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
version="""%prog version 1.1
|
version="%prog version 1.1",
|
||||||
|
description="Script to check LDAP syncrepl replication state between two servers.",
|
||||||
Date: Fri, 18 Dec 2020 10:48:45 +0100
|
epilog="Author: Benjamin Renard <brenard@easter-eggs.com>, Source: https://gogs.zionetrix.net/bn8/check_syncrepl_extended"
|
||||||
Author: Benjamin Renard <brenard@easter-eggs.com>
|
|
||||||
Source: https://gogs.zionetrix.net/bn8/check_syncrepl_extended
|
|
||||||
"""
|
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
|
Loading…
Reference in a new issue