A tool to generate yaml code for hieradata from APPUiO routes to configure
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. Routes created by ACME integration are ignored.
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/enabled
Setting this annotation to false will not create an entry for this route.
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.
monitoring/path
Setting this annotation on the route to a URI, will set the http_uri to the specified path. If the annoation is missing, and no route path is set, the http_uri will default to /.
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
http_uri: /
vars:
alert_customer: false
test-project.example.com:a:b:
display_name: test-project.example.com/a/b on APPUiO in my-test-project
http_address: test-project.example.com
http_ssl: true
http_uri: /a/b
vars:
alert_customer: false
test-project.example.com:a:b:c:
display_name: test-project.example.com/a/b/c on APPUiO in my-test-project
http_address: test-project.example.com
http_ssl: true
http_uri: /a/b/c/status
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 --upgrade pip
pip install -r requirements.in
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
File details
Details for the file appuio_routes_monitoring-1.2.1.tar.gz
.
File metadata
- Download URL: appuio_routes_monitoring-1.2.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c3e315b51b134d47743fa26db2b07988e22f3d66c6176f7edb3d159c037d496 |
|
MD5 | 888df2acf072aba70fc5bd26749d66f2 |
|
BLAKE2b-256 | ea5d4c4e101e7befb15ac30932bd6ccc293e13f5d18b3c82b162ca7676201d3e |
File details
Details for the file appuio_routes_monitoring-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: appuio_routes_monitoring-1.2.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35daf7d740598fe7939c6fec8c37caca614b5add81b406d05a3209fc8f9899aa |
|
MD5 | 896343d8a58123be7541f332bccd6a15 |
|
BLAKE2b-256 | be10aa3637e7922ec8ab593cb31db1c923d0d89af5ad149e463ef813e5d1976a |