Giter Club home page Giter Club logo

argos-ocp-alerts's Introduction

OpenShift Alerts Extension for Argos

This repo contains a simple extension for argos - and so therefore perhaps xbar* - to display active alerts for a configured set of OpenShift clusters.

* not tested

Configuration

Fill in the cluster details in clusters.yaml and copy to the config directory:

mkdir ~/.config/ocp-alerts
cp clusters.yaml ~/.config/ocp-alerts/

The syntax for the config is as follows:

clusters:
    cluster0:
        url: https://alertmanager-main-openshift-monitoring.apps.cloud.example.com
        token: eyJhbGciOiJSUzI1NiIsImtpZCI6IlRkUnBKcmktV1ZlbkZJOVZCOTNYWlNFcEZrWGI2
        severity: ["warning", "critical", "info"]
    cluster1:
        url: https://alertmanager-main-openshift-monitoring.apps.lab.example.com
        token: eyJhbGciOiJSUzI1NiIsImtpZCI6InFOYk0wNHA0YWdzZ3dJRGhNZ0xUWExIY0EtYlV
        severity: ["warning", "critical"]
    cluster2:
        url: https://alertmanager-main-openshift-monitoring.apps.qa.example.com
        token: eyJhbGciOiJSUzI1NiIsImtpZCI6ImY5bkRfN3FIQWw5Y3VUalhtd0Rscy1PS2NnWH
        severity: ["warning", "critical", "info"]

The url can be determined with:

oc get routes -n openshift-monitoring prometheus-k8s -o json | jq -r .spec.host

Any valid token with sufficient privileges will do, such as:

oc get secret -n openshift-monitoring $(oc get secret -n openshift-monitoring | grep prometheus-k8s-token | awk '{print $1}')  -o json | jq -r '.data.token|@base64d'

Copy ocp_alerts.py to ~/.config/argos and rename it to reflect desired update interval in seconds. For example, to run the script and update the status every 15 minutes, the script should be ~/.config/argos/ocp_alerts.1500s+.py.

Or you could just symlink it:

ln -s ~/code/path/to/repo/ocp_alerts.py ~/.config/argos/ocp_alerts.1500s+.py

Demo

This is how it should look:

screenshot

argos-ocp-alerts's People

Contributors

dcritch avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.