Skip to main content

appuio_routes_monitoring

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

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

Metadata

Release files for appuio-routes-monitoring 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for appuio-routes-monitoring 1.2.1
File Size Uploaded Provenance
appuio_routes_monitoring-1.2.1.tar.gz 5.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for appuio-routes-monitoring 1.2.1
File Interpreter ABI Platform
appuio_routes_monitoring-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / appuio_routes_monitoring-1.2.1.tar.gz

Download URL appuio_routes_monitoring-1.2.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5c3e315b51b134d47743fa26db2b07988e22f3d66c6176f7edb3d159c037d496
BLAKE2b-256 checksum
How to use checksums
ea5d4c4e101e7befb15ac30932bd6ccc293e13f5d18b3c82b162ca7676201d3e
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / appuio_routes_monitoring-1.2.1-py3-none-any.whl

Download URL appuio_routes_monitoring-1.2.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35daf7d740598fe7939c6fec8c37caca614b5add81b406d05a3209fc8f9899aa
BLAKE2b-256 checksum
How to use checksums
be10aa3637e7922ec8ab593cb31db1c923d0d89af5ad149e463ef813e5d1976a
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for appuio-routes-monitoring 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page