同步git和mercurial存储库的预备份脚本
appuio-routes-monitoring的Python项目详细描述
目录
Overview
appuio_routes_monitoring是一个从appuio生成hieradata的yaml代码的工具 要为这些路由配置http icinga2监视检查的路由。 但是脚本应该在任何openshift集群上工作。
appuio_routes_monitoring
appuio_routes_monitoring期望oc位于path变量中,您需要 在调用此脚本之前登录到appuio。
默认情况下,脚本将为登录用户有权访问的所有路由生成yaml代码。
有关详细信息,请参阅本文档的使用部分。
Dependencies
- appuio_routes_monitoring支持python>;=3.4,并具有以下第三方依赖项
- pyyaml(>;=3.10)
appuio_routes_monitoring进一步依赖于oc二进制文件从 openshift集群。
Installation
可以使用PIP轻松安装Appuio_Routes_Monitoring: pip安装appuio_routes_监控
Configuration
appuio_routes_monitoring没有任何配置文件。 但它确实依赖于appuio的二进制有效会话。 此外,脚本从路由读取注释以生成适当的 山药代码。 目前支持以下注释:
monitoring/alert_customer
将路由上的此注释设置为true,将把alert_customer变量设置为 是的也是。这将配置http检查以向定义的电子邮件地址发出警报。
monitoring/alert_vshn: ‘true’
将路由上的此批注设置为true,将设置检查的生产级别 若要4,请将支票设为24/7支票。这意味着只要检查失败,vshn就会收到警报。
monitoring/path
在到uri的路由上设置此注释将把http-uri设置为指定的路径。 如果缺少注释,则http-uri将默认为/。
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
为项目生成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
Development
运行开发版本
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