Skip to content
Snippets Groups Projects
Commit 405a00a4 authored by Pavel Břoušek's avatar Pavel Břoušek
Browse files

chore: merge branch 'fixes' into 'main'

move check_syncrepl_extended to the ldap extra, fix README

See merge request perun-proxy-aai/python/perun-proxy-utils!44
parents e5f5634c dff056ec
Branches
Tags
1 merge request!44move check_syncrepl_extended to the ldap extra, fix README
Pipeline #319037 passed with warnings
# Perun proxy utils # Perun proxy utils
Scripts and monitoring probes related to Perun ProxyIdP.
## Installation
Install via pip:
```sh
pip install perun.proxy.utils
```
There are several extras which are required only for some scripts:
- `[ldap]` for check_ldap and check_ldap_syncrepl
- this also requires installing [build prerequisites of the python-ldap library](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites)
- `[postgresql]` for check_pgsql
## Scripts ## Scripts
### run_probes.py ### run_probes
- script designed to execute multiple monitoring probes - script designed to execute multiple monitoring probes
- output is compatible with CheckMK - output is compatible with CheckMK
- it is required to put configuration file to `/etc/run_probes_cfg.yaml` - it is required to put configuration file to `/etc/run_probes_cfg.yaml`
- for usage run: `./run_probes.py` or `python3 -m perun.proxy.utils.run_probes`
For usage instructions, run:
```sh
run_probes
```
### separate_ssp_script.py ### separate_ssp_script.py
...@@ -52,32 +73,48 @@ ...@@ -52,32 +73,48 @@
All nagios scripts are located under `nagios` directory. All nagios scripts are located under `nagios` directory.
### check_mongodb.py ### check_mongodb
Nagios monitoring probe for mongodb.
Tested options:
- nagios monitoring probe for mongodb - connect
- connections
- replication_lag
- replset_state
- connect, connections, replication_lag, replset_state monitoring options are tested (some possible options may not work since there are constructs which are not supported by latest mongodb versions) (some possible options may not work since there are constructs which are not supported by the latest mongodb versions)
- for usage run: For usage instructions, run:
`python3 check_mongodb.py --help`
```sh
check_mongodb --help
```
### check_saml.py ### check_saml.py
- SAML authentication check SAML authentication check compatible with SimpleSAMLphp and mitreID.
- for usage run: For usage instructions, run:
`python3 check_saml.py --help`
### check_user_logins.py ```sh
check_saml --help
```
- check users which login in repeatedly more often than a specified threshold (logins per seconds) ### check_user_logins.py
- for usage run: Check users which login in repeatedly more often than a specified threshold (logins per seconds).
`python3 check_user_logins.py --help`
- example: For usage instructions, run:
```sh
check_user_logins --help
``` ```
Example:
```sh
python3 check_user_logins.py python3 check_user_logins.py
-p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log -p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log
-l 5 -l 5
...@@ -86,46 +123,43 @@ python3 check_user_logins.py ...@@ -86,46 +123,43 @@ python3 check_user_logins.py
-d "%b %d %Y %H:%M:%S" -d "%b %d %Y %H:%M:%S"
``` ```
### check_ldap.py ### check_ldap
Check whether an LDAP server is available.
- check whether LDAP is available For usage instructions, run:
- to use this check, you must install the ldap extra:
```sh ```sh
pip install perun.proxy.utils[ldap] check_ldap --help
``` ```
and the [build prerequisites of the python-ldap library](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites) ### check_ldap_syncrepl
- for usage run: Check whether an LDAP replica is up to date with the provider.
```sh #### Usage
python3 check_ldap.py --help
```
### check_privacyidea.py ```sh
check_ldap_syncrepl --help
```
- check whether privacyidea is available ### check_privacyidea
- use caching arguments for avoiding failure when one TOTP code is used two times
- for usage run: Check whether privacyidea is available by performing TOTP authentication via the API.
Use caching arguments for avoiding failure when one TOTP code is used two times.
```sh For usage instructions, run:
python3 check_privacyidea.py --help
```
### check_pgsql.py ```sh
check_privacyidea --help
```
- check connection to PostgreSQL ### check_pgsql
- possible check with configurable query
- to use this check you must include the postgresql extra, which will install [psycopg2-binary](https://pypi.org/project/psycopg2-binary/):
```sh Check connection to PostgreSQL using a configurable query.
pip install perun.proxy.utils[postgresql]
```
- for usage run: For usage instructions, run:
```sh ```sh
python3 check_pgpsql.py --help check_pgsql --help
``` ```
...@@ -15,13 +15,13 @@ setuptools.setup( ...@@ -15,13 +15,13 @@ setuptools.setup(
"beautifulsoup4~=4.12", "beautifulsoup4~=4.12",
"requests~=2.31", "requests~=2.31",
"PyYAML>=5.4,<7.0", "PyYAML>=5.4,<7.0",
"check_syncrepl_extended~=2020.13",
"check_nginx_status~=1.0", "check_nginx_status~=1.0",
"pyotp~=2.9", "pyotp~=2.9",
], ],
extras_require={ extras_require={
"ldap": [ "ldap": [
"ldap3~=2.9.1", "ldap3~=2.9.1",
"check_syncrepl_extended~=2020.13",
], ],
"postgresql": [ "postgresql": [
"psycopg2-binary~=2.9", "psycopg2-binary~=2.9",
...@@ -45,7 +45,7 @@ setuptools.setup( ...@@ -45,7 +45,7 @@ setuptools.setup(
"check_webserver_availability=" "check_webserver_availability="
"perun.proxy.utils.nagios.webserver_availability:main", "perun.proxy.utils.nagios.webserver_availability:main",
"check_privacyidea=perun.proxy.utils.nagios.check_privacyidea:main", "check_privacyidea=perun.proxy.utils.nagios.check_privacyidea:main",
"check_pgsql=perun.proxy.utils.nagios.check_pgsql:main" "check_pgsql=perun.proxy.utils.nagios.check_pgsql:main",
"metadata_expiration=perun.proxy.utils.metadata_expiration:main", "metadata_expiration=perun.proxy.utils.metadata_expiration:main",
"print_docker_versions=perun.proxy.utils.print_docker_versions:main", "print_docker_versions=perun.proxy.utils.print_docker_versions:main",
"run_version_script=perun.proxy.utils.run_version_script:main", "run_version_script=perun.proxy.utils.run_version_script:main",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment