Compare commits
22 commits
v2019.12.2
...
master
Author | SHA1 | Date | |
---|---|---|---|
Benjamin Renard | 057ddf2a0b | ||
Benjamin Renard | 022c8fe7f6 | ||
Benjamin Renard | f3f8ae9f1a | ||
67aaf9852c | |||
f1a1cc3193 | |||
cdf35ecd5a | |||
f24ce7f266 | |||
Benjamin Renard | 4dc2425387 | ||
d8a6267d7a | |||
b1953a5b51 | |||
d33df5c23d | |||
Benjamin Renard | a3d6c8cfb0 | ||
2f6d97f761 | |||
5ce72df6dc | |||
09722e94af | |||
0b51046476 | |||
7153dfea86 | |||
36f9a09a34 | |||
9e6de5077f | |||
3c39ff7488 | |||
d9ac73473d | |||
d19d121843 |
89
.forgejo/workflows/release.yaml
Normal file
89
.forgejo/workflows/release.yaml
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
---
|
||||||
|
name: Build and publish Debian package
|
||||||
|
on: [create]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/brenard/debian-python-deb:latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Build Debian package
|
||||||
|
env:
|
||||||
|
MAINTAINER_NAME: ${{ vars.MAINTAINER_NAME }}
|
||||||
|
MAINTAINER_EMAIL: ${{ vars.MAINTAINER_EMAIL }}
|
||||||
|
DEBIAN_CODENAME: ${{ vars.DEBIAN_CODENAME }}
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.GPG_KEY }}"|base64 -d|gpg --import
|
||||||
|
./build.sh
|
||||||
|
mv check_syncrepl_extended dist/
|
||||||
|
- name: Upload Debian package files
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: |
|
||||||
|
dist/*.buildinfo
|
||||||
|
dist/*.changes
|
||||||
|
dist/*.deb
|
||||||
|
dist/*.dsc
|
||||||
|
dist/*.tar.gz
|
||||||
|
dist/release_notes.md
|
||||||
|
dist/check_syncrepl_extended
|
||||||
|
|
||||||
|
publish-forgejo:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/brenard/debian-python-deb:latest
|
||||||
|
steps:
|
||||||
|
- name: Download Debian package files
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
|
||||||
|
- name: Create the release
|
||||||
|
id: create-release
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir release
|
||||||
|
mv *.deb release/
|
||||||
|
mv check_syncrepl_extended release/
|
||||||
|
md5sum release/* > md5sum.txt
|
||||||
|
sha512sum release/* > sha512sum.txt
|
||||||
|
mv md5sum.txt sha512sum.txt release/
|
||||||
|
{
|
||||||
|
echo 'release_note<<EOF'
|
||||||
|
cat release_notes.md
|
||||||
|
echo 'EOF'
|
||||||
|
} >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Publish release on Forgejo
|
||||||
|
uses: actions/forgejo-release@v1
|
||||||
|
with:
|
||||||
|
direction: upload
|
||||||
|
url: https://gitea.zionetrix.net
|
||||||
|
token: ${{ secrets.forgejo_token }}
|
||||||
|
release-dir: release
|
||||||
|
release-notes: ${{ steps.create-release.outputs.release_note }}
|
||||||
|
|
||||||
|
publish-aptly:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/brenard/aptly-publish:latest
|
||||||
|
steps:
|
||||||
|
- name: "Download Debian package files"
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
|
||||||
|
- name: "Publish Debian package on Aptly repository"
|
||||||
|
uses: https://gitea.zionetrix.net/bn8/aptly-publish@master
|
||||||
|
with:
|
||||||
|
api_url: ${{ vars.apt_api_url }}
|
||||||
|
api_username: ${{ vars.apt_api_username }}
|
||||||
|
api_password: ${{ secrets.apt_api_password }}
|
||||||
|
repo_name: ${{ vars.apt_repo_name }}
|
||||||
|
path: "./"
|
||||||
|
source_name: ${{ vars.apt_source_name }}
|
21
.forgejo/workflows/tests.yaml
Normal file
21
.forgejo/workflows/tests.yaml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
---
|
||||||
|
name: Run tests
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
test-precommit:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: docker.io/brenard/python-pre-commit:latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install python dependencies
|
||||||
|
env:
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
run: |
|
||||||
|
apt-get -qq update
|
||||||
|
apt-get -qq -y install --no-install-recommends python3-ldap
|
||||||
|
- name: Run pre-commit
|
||||||
|
run: pre-commit run --all-files
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
*~
|
*~
|
||||||
|
dist/
|
||||||
|
|
64
.pre-commit-config.yaml
Normal file
64
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
# Pre-commit hooks to run tests and ensure code is cleaned.
|
||||||
|
# See https://pre-commit.com for more information
|
||||||
|
---
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
rev: v0.1.6
|
||||||
|
hooks:
|
||||||
|
- id: ruff
|
||||||
|
args: ["--fix"]
|
||||||
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
|
rev: v3.15.0
|
||||||
|
hooks:
|
||||||
|
- id: pyupgrade
|
||||||
|
args: ["--keep-percent-format", "--py37-plus"]
|
||||||
|
- repo: https://github.com/psf/black
|
||||||
|
rev: 23.11.0
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
args: ["--target-version", "py37", "--line-length", "100"]
|
||||||
|
- repo: https://github.com/PyCQA/isort
|
||||||
|
rev: 5.12.0
|
||||||
|
hooks:
|
||||||
|
- id: isort
|
||||||
|
args: ["--profile", "black", "--line-length", "100"]
|
||||||
|
- repo: https://github.com/PyCQA/flake8
|
||||||
|
rev: 6.1.0
|
||||||
|
hooks:
|
||||||
|
- id: flake8
|
||||||
|
args: ["--max-line-length=100"]
|
||||||
|
- repo: https://github.com/codespell-project/codespell
|
||||||
|
rev: v2.2.2
|
||||||
|
hooks:
|
||||||
|
- id: codespell
|
||||||
|
args:
|
||||||
|
- --ignore-words-list=exten
|
||||||
|
- --skip="./.*,*.csv,*.json,*.ini,*.subject,*.txt,*.html,*.log,*.conf"
|
||||||
|
- --quiet-level=2
|
||||||
|
- --ignore-regex=.*codespell-ignore$
|
||||||
|
# - --write-changes # Uncomment to write changes
|
||||||
|
exclude_types: [csv, json]
|
||||||
|
- repo: https://github.com/adrienverge/yamllint
|
||||||
|
rev: v1.32.0
|
||||||
|
hooks:
|
||||||
|
- id: yamllint
|
||||||
|
ignore: .github/
|
||||||
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
|
rev: v2.7.1
|
||||||
|
hooks:
|
||||||
|
- id: prettier
|
||||||
|
args: ["--print-width", "100"]
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: pylint
|
||||||
|
name: pylint
|
||||||
|
entry: pylint
|
||||||
|
language: system
|
||||||
|
types: [python]
|
||||||
|
require_serial: true
|
||||||
|
- repo: https://github.com/PyCQA/bandit
|
||||||
|
rev: 1.7.5
|
||||||
|
hooks:
|
||||||
|
- id: bandit
|
||||||
|
args: [--skip, "B101", --recursive]
|
||||||
|
minimum_pre_commit_version: 3.2.0
|
8
.pylintrc
Normal file
8
.pylintrc
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[MESSAGES CONTROL]
|
||||||
|
disable=line-too-long,
|
||||||
|
missing-docstring,
|
||||||
|
invalid-name,
|
||||||
|
locally-disabled,
|
||||||
|
too-many-arguments,
|
||||||
|
too-many-branches,
|
||||||
|
redefined-outer-name,
|
135
README.md
135
README.md
|
@ -1,42 +1,77 @@
|
||||||
Script to check LDAP syncrepl replication state between two servers
|
# Script to check LDAP syncrepl replication state between two servers
|
||||||
===================================================================
|
|
||||||
|
|
||||||
This script check LDAP syncrepl replication state between two servers.
|
This script check LDAP syncrepl replication state between two servers.
|
||||||
One server is consider as provider and the other as consumer.
|
One server is consider as provider and the other as consumer.
|
||||||
|
|
||||||
This script can check replication state with two method :
|
This script can check replication state with two method :
|
||||||
- by the fisrt, entryCSN of all entries of LDAP directory will be compare between two servers
|
|
||||||
- by the second, all values of all atributes of all entries will be compare between two servers.
|
|
||||||
|
|
||||||
In all case, contextCSN of servers will be compare and entries not present in consumer or in provider will be notice. You can decide to disable contextCSN verification by using argument *--no-check-contextCSN*.
|
- by the first, entryCSN of all entries of LDAP directory will be compare between two servers
|
||||||
|
- by the second, all values of all attributes of all entries will be compare between two servers.
|
||||||
|
|
||||||
This script is also able to *"touch"* LDAP object on provider to force synchronisation of this object. This mechanism consist to add *'%%TOUCH%%'* value to an attribute of this object and remove it just after. The
|
In all case, contextCSN of servers will be compare and entries not present in consumer or in provider will be notice. You can decide to disable contextCSN verification by using argument _--no-check-contextCSN_.
|
||||||
touched attribute is specify by parameter *--touch*. Of course, couple of DN and password provided, must have write right on this attribute.
|
|
||||||
|
|
||||||
If your prefer, you can use *--replace-touch* parameter to replace value of touched attribute instead of adding the touched value. Use-ful in case of single-value attribute.
|
This script is also able to _"touch"_ LDAP object on provider to force synchronisation of this object. This mechanism consist to add _'%%TOUCH%%'_ value to an attribute of this object and remove it just after. The
|
||||||
|
touched attribute is specify by parameter _--touch_. Of course, couple of DN and password provided, must have write right on this attribute.
|
||||||
|
|
||||||
To use this script as an Icinga (or Nagios) plugin, use *-n* argument
|
If your prefer, you can use _--replace-touch_ parameter to replace value of touched attribute instead of adding the touched value. Use-ful in case of single-value attribute.
|
||||||
|
|
||||||
Requirement
|
To use this script as an Icinga (or Nagios) plugin, use _-n_ argument
|
||||||
-----------
|
|
||||||
|
## Requirement
|
||||||
|
|
||||||
A single couple of DN and password able to connect to both server and without restriction to retrieve objects from servers.
|
A single couple of DN and password able to connect to both server and without restriction to retrieve objects from servers.
|
||||||
|
|
||||||
Usage
|
## Dependencies
|
||||||
-----
|
|
||||||
```
|
|
||||||
Usage: check_syncrepl_extended [options]
|
|
||||||
|
|
||||||
Options:
|
- python 3 (for python 2.7 compatibility, see python2.7 branch)
|
||||||
--version show program's version number and exit
|
- python-ldap
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
### If you plan to use it with NRPE
|
||||||
|
|
||||||
|
```
|
||||||
|
apt install -y python3-ldap git
|
||||||
|
git clone https://gitea.zionetrix.net/bn8/check_syncrepl_extended.git /usr/local/src/check_syncrepl_extended
|
||||||
|
mkdir -p /usr/local/lib/nagios/plugins
|
||||||
|
ln -s /usr/local/src/check_syncrepl_extended/check_syncrepl_extended /usr/local/lib/nagios/plugins/
|
||||||
|
cat << EOF > /etc/nagios/nrpe.d/ldap-syncrepl.cfg
|
||||||
|
command[check_syncrepl_extended]=/usr/local/lib/nagios/plugins/check_syncrepl_extended --nagios --attributes --provider ldaps://ldapmaster.foo --consumer ldaps://ldapslave.foo --basedn o=example -D uid=nagios,ou=sysaccounts,o=example -P secret
|
||||||
|
EOF
|
||||||
|
service nagios-nrpe-server reload
|
||||||
|
```
|
||||||
|
|
||||||
|
### Otherwise
|
||||||
|
|
||||||
|
```
|
||||||
|
apt install python3-ldap git
|
||||||
|
git clone https://gitea.zionetrix.net/bn8/check_syncrepl_extended.git /usr/local/src/check_syncrepl_extended
|
||||||
|
ln -s /usr/local/src/check_syncrepl_extended/check_syncrepl_extended /usr/local/bin/
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
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]
|
||||||
|
|
||||||
|
Script to check LDAP syncrepl replication state between two servers.
|
||||||
|
|
||||||
|
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
|
||||||
LDAP provider URI (example :
|
-p PROVIDER, --provider PROVIDER
|
||||||
|
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,47 +79,47 @@ 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
|
||||||
-q, --quiet Quiet mode
|
-q, --quiet Quiet mode
|
||||||
--no-check-certificate
|
--no-check-certificate
|
||||||
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 attribute (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 : if defined, paging control using LDAP v3
|
--page-size PAGE_SIZE
|
||||||
|
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://gitea.zionetrix.net/bn8/check_syncrepl_extended
|
||||||
```
|
```
|
||||||
|
|
||||||
Copyright
|
## Copyright
|
||||||
---------
|
|
||||||
|
|
||||||
Copyright (c) 2017 Benjamin Renard
|
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.
|
||||||
|
|
62
build.sh
Executable file
62
build.sh
Executable file
|
@ -0,0 +1,62 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
QUIET_ARG=""
|
||||||
|
[ "$1" == "--quiet" ] && QUIET_ARG="--quiet"
|
||||||
|
|
||||||
|
# Enter source directory
|
||||||
|
cd $( dirname $0 )
|
||||||
|
|
||||||
|
echo "Clean previous build..."
|
||||||
|
rm -fr dist
|
||||||
|
|
||||||
|
echo "Detect version using git describe..."
|
||||||
|
VERSION="$( git describe --tags|sed 's/^[^0-9]*//' )"
|
||||||
|
|
||||||
|
echo "Create building environemt..."
|
||||||
|
BDIR=dist/check-syncrepl-extended-$VERSION
|
||||||
|
mkdir -p $BDIR
|
||||||
|
[ -z "$QUIET_ARG" ] && RSYNC_ARG="-v" || RSYNC_ARG=""
|
||||||
|
rsync -a $RSYNC_ARG debian/ $BDIR/debian/
|
||||||
|
cp check_syncrepl_extended $BDIR/
|
||||||
|
|
||||||
|
echo "Set VERSION=$VERSION in gitdch using sed..."
|
||||||
|
sed -i "s/^VERSION *=.*$/VERSION = '$VERSION'/" $BDIR/check_syncrepl_extended
|
||||||
|
|
||||||
|
if [ -z "$DEBIAN_CODENAME" ]
|
||||||
|
then
|
||||||
|
echo "Retrieve debian codename using lsb_release..."
|
||||||
|
DEBIAN_CODENAME=$( lsb_release -c -s )
|
||||||
|
else
|
||||||
|
echo "Use debian codename from environment ($DEBIAN_CODENAME)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Generate debian changelog using gitdch..."
|
||||||
|
GITDCH_ARGS=('--verbose')
|
||||||
|
[ -n "$QUIET_ARG" ] && GITDCH_ARGS=('--warning')
|
||||||
|
if [ -n "$MAINTAINER_NAME" ]
|
||||||
|
then
|
||||||
|
echo "Use maintainer name from environment ($MAINTAINER_NAME)"
|
||||||
|
GITDCH_ARGS+=("--maintainer-name" "${MAINTAINER_NAME}")
|
||||||
|
fi
|
||||||
|
if [ -n "$MAINTAINER_EMAIL" ]
|
||||||
|
then
|
||||||
|
echo "Use maintainer email from environment ($MAINTAINER_EMAIL)"
|
||||||
|
GITDCH_ARGS+=("--maintainer-email" "$MAINTAINER_EMAIL")
|
||||||
|
fi
|
||||||
|
gitdch \
|
||||||
|
--package-name check-syncrepl-extended \
|
||||||
|
--version "${VERSION}" \
|
||||||
|
--code-name $DEBIAN_CODENAME \
|
||||||
|
--output $BDIR/debian/changelog \
|
||||||
|
--release-notes dist/release_notes.md \
|
||||||
|
"${GITDCH_ARGS[@]}"
|
||||||
|
|
||||||
|
if [ -n "$MAINTAINER_NAME" -a -n "$MAINTAINER_EMAIL" ]
|
||||||
|
then
|
||||||
|
echo "Set Maintainer field in debian control file ($MAINTAINER_NAME <$MAINTAINER_EMAIL>)..."
|
||||||
|
sed -i "s/^Maintainer: .*$/Maintainer: $MAINTAINER_NAME <$MAINTAINER_EMAIL>/" $BDIR/debian/control
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Build debian package..."
|
||||||
|
cd $BDIR
|
||||||
|
dpkg-buildpackage
|
File diff suppressed because it is too large
Load diff
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
11
|
30
debian/control
vendored
Normal file
30
debian/control
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
Source: check-syncrepl-extended
|
||||||
|
Section: admin
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: Debian Zionetrix - check-syncrepl-extended <debian+check-syncrepl-extended@zionetrix.net>
|
||||||
|
Build-Depends: debhelper (>> 11.0.0)
|
||||||
|
Standards-Version: 3.9.6
|
||||||
|
|
||||||
|
Package: check-syncrepl-extended
|
||||||
|
Architecture: all
|
||||||
|
Depends: ${misc:Depends}, python3, python3-ldap
|
||||||
|
Description: Check LDAP syncrepl replication state between two servers
|
||||||
|
This script check LDAP syncrepl replication state between two servers. One
|
||||||
|
server is consider as provider and the other as consumer.
|
||||||
|
This script can check replication state with two method :
|
||||||
|
- by the first, entryCSN of all entries of LDAP directory will be compare
|
||||||
|
between two servers
|
||||||
|
- by the second, all values of all attributes of all entries will be compare
|
||||||
|
between two servers.
|
||||||
|
In all case, contextCSN of servers will be compare and entries not present in
|
||||||
|
consumer or in provider will be notice. You can decide to disable contextCSN
|
||||||
|
verification by using argument --no-check-contextCSN.
|
||||||
|
This script is also able to "touch" LDAP object on provider to force
|
||||||
|
synchronisation of this object. This mechanism consist to add '%%TOUCH%%'
|
||||||
|
value to an attribute of this object and remove it just after. The touched
|
||||||
|
attribute is specify by parameter --touch. Of course, couple of DN and
|
||||||
|
password provided, must have write right on this attribute.
|
||||||
|
If your prefer, you can use --replace-touch parameter to replace value of
|
||||||
|
touched attribute instead of adding the touched value. Use-ful in case of
|
||||||
|
single-value attribute.
|
||||||
|
To use this script as an Icinga (or Nagios) plugin, use -n argument
|
20
debian/copyright
vendored
Normal file
20
debian/copyright
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
This package was written by Benjamin Renard <brenard@zionetrix.net>.
|
||||||
|
|
||||||
|
Copyright (C) 2022 Benjamin Renard <brenard@zionetrix.net>
|
||||||
|
|
||||||
|
check-syncrepl-extended is licensed under the GNU general public license, version 3.
|
||||||
|
|
||||||
|
check-syncrepl-extended is free software; you can redistribute it and/or modify it under
|
||||||
|
the terms of the GNU General Public License as published by the Free Software
|
||||||
|
Foundation; either version 2, or (at your option) any later version.
|
||||||
|
|
||||||
|
check-syncrepl-extended 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
|
||||||
|
check-syncrepl-extended; see the file COPYING. If not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
On Debian systems, a copy of the GNU General Public License is available in
|
||||||
|
/usr/share/common-licenses/GPL-3 as part of the base-files package.
|
1
debian/dirs
vendored
Normal file
1
debian/dirs
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
usr/lib/nagios/plugins
|
1
debian/install
vendored
Normal file
1
debian/install
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
check_syncrepl_extended usr/lib/nagios/plugins
|
4
debian/rules
vendored
Executable file
4
debian/rules
vendored
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/make -f
|
||||||
|
#export DH_VERBOSE=1
|
||||||
|
%:
|
||||||
|
dh $@
|
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
1.0
|
|
@ -1,27 +1,24 @@
|
||||||
|
---
|
||||||
name: check_syncrepl_extended
|
name: check_syncrepl_extended
|
||||||
description: "file:///README.md"
|
description: "file:///README.md"
|
||||||
url: "https://gogs.zionetrix.net/bn8/check_syncrepl_extended"
|
url: "https://gitea.zionetrix.net/bn8/check_syncrepl_extended"
|
||||||
tags: OpenLDAP,syncrepl
|
tags: OpenLDAP,syncrepl
|
||||||
vendor: OpenLDAP
|
vendor: OpenLDAP
|
||||||
target: Database
|
target: Database
|
||||||
type: Plugin
|
type: Plugin
|
||||||
license: gplv2
|
license: gplv2
|
||||||
releases:
|
releases:
|
||||||
-
|
- name: v2017.09.11
|
||||||
name: v2017.09.11
|
|
||||||
description: "v2017.09.11 Release"
|
description: "v2017.09.11 Release"
|
||||||
files:
|
files:
|
||||||
-
|
- name: check_syncrepl_extended
|
||||||
name: check_syncrepl_extended
|
|
||||||
url: "file:///check_syncrepl_extended"
|
url: "file:///check_syncrepl_extended"
|
||||||
description: "First release upload on Icinga Exchange"
|
description: "First release upload on Icinga Exchange"
|
||||||
checksum: cee2e8fdc243edcbab30d3b034e8b9bf
|
checksum: cee2e8fdc243edcbab30d3b034e8b9bf
|
||||||
-
|
- name: v2017.09.12
|
||||||
name: v2017.09.12
|
|
||||||
description: "v2017.09.12 Release"
|
description: "v2017.09.12 Release"
|
||||||
files:
|
files:
|
||||||
-
|
- name: check_syncrepl_extended
|
||||||
name: check_syncrepl_extended
|
|
||||||
url: "file:///check_syncrepl_extended"
|
url: "file:///check_syncrepl_extended"
|
||||||
description: "Improve ContextCSN checking (thanks Orhan)"
|
description: "Improve ContextCSN checking (thanks Orhan)"
|
||||||
checksum: a954ca49855c23f2f098f4696c4c0ebd
|
checksum: a954ca49855c23f2f098f4696c4c0ebd
|
||||||
|
|
Loading…
Reference in a new issue