diff --git a/README.md b/README.md index 43058c4e9d8f4656639af672767bd67f1176f329..51a3aa501d5b21258e2534c7b5e9404cb3ed7d25 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,34 @@ # 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 -### run_probes.py +### run_probes - script designed to execute multiple monitoring probes - output is compatible with CheckMK - 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 @@ -52,32 +73,48 @@ 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: - `python3 check_mongodb.py --help` +For usage instructions, run: + +```sh +check_mongodb --help +``` ### check_saml.py -- SAML authentication check +SAML authentication check compatible with SimpleSAMLphp and mitreID. -- for usage run: - `python3 check_saml.py --help` +For usage instructions, run: -### 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: - `python3 check_user_logins.py --help` +Check users which login in repeatedly more often than a specified threshold (logins per seconds). -- example: +For usage instructions, run: +```sh +check_user_logins --help ``` + +Example: + +```sh python3 check_user_logins.py -p /var/log/proxyaai/simplesamlphp/simplesamlphp/simplesamlphp.log -l 5 @@ -86,46 +123,43 @@ python3 check_user_logins.py -d "%b %d %Y %H:%M:%S" ``` -### check_ldap.py +### check_ldap + +Check whether an LDAP server is available. -- check whether LDAP is available -- to use this check, you must install the ldap extra: +For usage instructions, run: - ```sh - pip install perun.proxy.utils[ldap] - ``` +```sh +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 - python3 check_ldap.py --help - ``` +#### Usage -### check_privacyidea.py +```sh +check_ldap_syncrepl --help +``` -- check whether privacyidea is available -- use caching arguments for avoiding failure when one TOTP code is used two times +### check_privacyidea -- 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 - python3 check_privacyidea.py --help - ``` +For usage instructions, run: -### check_pgsql.py +```sh +check_privacyidea --help +``` -- check connection to PostgreSQL -- 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/): +### check_pgsql - ```sh - pip install perun.proxy.utils[postgresql] - ``` +Check connection to PostgreSQL using a configurable query. -- for usage run: +For usage instructions, run: - ```sh - python3 check_pgpsql.py --help - ``` +```sh +check_pgsql --help +``` diff --git a/setup.py b/setup.py index d8716af6b36a7f0ec8661e34b58992cd3bd65944..1730994c0688b482591511ae26c3ca3f3d688b27 100644 --- a/setup.py +++ b/setup.py @@ -15,13 +15,13 @@ setuptools.setup( "beautifulsoup4~=4.12", "requests~=2.31", "PyYAML>=5.4,<7.0", - "check_syncrepl_extended~=2020.13", "check_nginx_status~=1.0", "pyotp~=2.9", ], extras_require={ "ldap": [ "ldap3~=2.9.1", + "check_syncrepl_extended~=2020.13", ], "postgresql": [ "psycopg2-binary~=2.9", @@ -45,7 +45,7 @@ setuptools.setup( "check_webserver_availability=" "perun.proxy.utils.nagios.webserver_availability: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", "print_docker_versions=perun.proxy.utils.print_docker_versions:main", "run_version_script=perun.proxy.utils.run_version_script:main",