Pre-Backup script that synchronises git and mercurial repositories
Project description
Overview
appuio_routes_monitoring is a tool to generate yaml code for hieradata from APPUiO routes to configure http icinga2 monitoring checks for those routes. However the script should work on any openshift cluster.
appuio_routes_monitoring
appuio_routes_monitoring expects the oc to be in the path variable and you need to be logged in to APPUiO before calling this script.
By default the script will generate yaml code for all routes the logged in user has access to.
See usage section of this document for details.
Dependencies
- appuio_routes_monitoring supports python >=3.4 and has the following 3rd-party dependencies
pyyaml (>= 3.10)
appuio_routes_monitoring further relies on the oc binary to extract the routes from the openshift cluster.
Installation
appuio_routes_monitoring can be easily installed using pip: pip install appuio_routes_monitoring
Configuration
appuio_routes_monitoring does not have any configuration files. But it does rely on the oc binary and valid session to APPUiO. Furthermore the script reads annotations from the routes to generate the appropriate yaml code. Currently the following annotations are supported:
monitoring/alert_customer
Setting this annotation on the route to true, will set the alert_customer variable to true as well. This will configure the http check to alert to the defined e-mail address.
monitoring/alert_vshn: ‘true’
Setting this annotation on the route to true, will set the production_level of the check to 4, making the check a 24/7 check. This means VSHN will be alerted anytime the check fails.
Usage
usage: generate_monitoring_check [-h] [-p PROJECTS [PROJECTS ...]] [-k HIERAKEY]
generate hieradata from appuio routes
optional arguments:
-h, --help show this help message and exit
-p PROJECTS [PROJECTS ...], --project PROJECTS [PROJECTS ...]
-k HIERAKEY, --key HIERAKEY
Examples
Generate yaml code for project my-test-project
generate_monitoring_check -p my-test-project
profile_icinga2::hiera_httpchecks:
test-project.example.com:
display_name: test-project.example.com on APPUiO in my-test-project
http_address: test-project.example.com
http_ssl: true
vars:
alert_customer: false
Development
run development version
git clone git@git.vshn.net:vshn/appuio_routes_monitoring.git
cd appuio_routes_monitoring
python -m venv pyvenv
. pyvenv/bin/activate
pip install -r requirements.txt
python -m appuio_routes_monitoring
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for appuio_routes_monitoring-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6415be3337d9870e5edad4cd5800ff32ca96e7e1f323cf9f17a06245b6c3fc4 |
|
MD5 | 28112ec313e84d8efdd0844537289a4f |
|
BLAKE2b-256 | e1ff8ef4f01098b74a540714d106084e3f8eb6684a0787161b8ee7c97ce84eb3 |
Hashes for appuio_routes_monitoring-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7f79056f583b1a7f0b1b8af488a47af6c16cd17ae002ede3811b5fe1698b59b |
|
MD5 | 828465ac2ab86036c085aca63423454d |
|
BLAKE2b-256 | 7c307d95d1219aeb6bc38cf710e4074d0806042e99f98962e1aee37f9f2ad5b0 |