Package: appuio-routes-monitoring
Table of ContentsOverviewappuio_routes_monitoringDependenciesInstallationConfigurationmonitoring/enabledmonitoring/alert_customermonitoring/alert_vshn: ‘true’monitoring/pathUsageExamplesDevelopmentOverviewappuio_routes_monitoringis 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_monitoringappuio_routes_monitoringexpects theocto 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.Dependenciesappuio_routes_monitoringsupports python >=3.4 and has the following 3rd-party dependenciespyyaml(>= 3.10)appuio_routes_monitoringfurther relies on theocbinary to extract the routes from the
openshift cluster.Installationappuio_routes_monitoringcan be easily installed using pip:pip install appuio_routes_monitoringConfigurationappuio_routes_monitoringdoes not have any configuration files.
But it does rely on theocbinary 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/enabledSetting this annotation to false will not create an entry for this route.monitoring/alert_customerSetting this annotation on the route totrue, will set thealert_customervariable totrueas 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 totrue, will set theproduction_levelof the check
to4, making the check a 24/7 check. This means VSHN will be alerted anytime the check fails.monitoring/pathSetting 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/.Usageusage: 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 HIERAKEYExamplesGenerate yaml code for projectmy-test-projectgenerate_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: falseDevelopmentrun development versiongitclonegit@git.vshn.net:vshn/appuio_routes_monitoring.gitcdappuio_routes_monitoringpython-mvenvpyvenv.pyvenv/bin/activatepipinstall--upgradepippipinstall-rrequirements.inpython-mappuio_routes_monitoring