一个从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,并具有以下第三方依赖项
pyyaml (>= 3.10)
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的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 5c3e315b51b134d47743fa26db2b07988e22f3d66c6176f7edb3d159c037d496 |
|
MD5 | 888df2acf072aba70fc5bd26749d66f2 |
|
BLAKE2b-256 | ea5d4c4e101e7befb15ac30932bd6ccc293e13f5d18b3c82b162ca7676201d3e |
appuio_routes_monitoring-1.2.1-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 35daf7d740598fe7939c6fec8c37caca614b5add81b406d05a3209fc8f9899aa |
|
MD5 | 896343d8a58123be7541f332bccd6a15 |
|
BLAKE2b-256 | be10aa3637e7922ec8ab593cb31db1c923d0d89af5ad149e463ef813e5d1976a |