跳转到主要内容

一个从APPUiO路由生成hiera数据的yaml代码的工具,用于配置这些路由的http icinga2监控检查。

项目描述

概述

appuio_routes_monitoring 是一个工具,可以从APPUiO路由生成yaml代码,用于配置这些路由的http icinga2监控检查。然而,该脚本应在任何OpenShift集群上工作。

appuio_routes_monitoring

appuio_routes_monitoring 期望 oc 在路径变量中,您在调用此脚本之前需要登录到APPUiO。

默认情况下,脚本将为登录用户可访问的所有路由生成yaml代码。由ACME集成创建的路由将被忽略。

请参阅本文件的用法部分以获取详细信息。

依赖关系

appuio_routes_monitoring 支持 python >=3.4,并具有以下第三方依赖项

appuio_routes_monitoring 还依赖于 oc 二进制文件以从OpenShift集群中提取路由。

安装

appuio_routes_monitoring 可以通过pip轻松安装:pip install appuio_routes_monitoring

配置

appuio_routes_monitoring 没有任何配置文件。但它依赖于 oc 二进制文件和有效的APPUiO会话。此外,该脚本从路由中读取注释以生成相应的yaml代码。目前支持的注释如下

monitoring/enabled

将此注释设置为false将不会为该路由创建条目。

monitoring/alert_customer

将此注释设置为路由的true,也将设置alert_customer变量为true。这将配置http检查以向定义的电子邮件地址发出警报。

monitoring/alert_vshn: ‘true’

将此注释设置为路由的true,将检查的production_level设置为4,使检查成为全天候检查。这意味着当检查失败时,VSHN将随时收到警报。

monitoring/path

将此注释设置为路由的URI,将http_uri设置为指定的路径。如果缺少此注释,且未设置路由路径,则http_uri将默认为/

使用

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

示例

为项目my-test-project生成yaml代码

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

开发

运行开发版本

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

项目详情


下载文件

下载您平台上的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分布

appuio_routes_monitoring-1.2.1.tar.gz (5.3 kB 查看哈希值)

上传时间

构建分布

appuio_routes_monitoring-1.2.1-py3-none-any.whl (6.6 kB 查看哈希值)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面