Giter Site home page Giter Site logo

riotkit-org / riothealthflux Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 716 KB

Collects healthcheck statuses from UptimeRobot and Infracheck as sources, then pushes to InfluxDB

License: Apache License 2.0

PHP 98.09% Shell 1.91%
monitoring server server-monitoring uptimerobot uptimerobot-api uptime-robot dashboard healthcheck anarchist anarchist-federation

riothealthflux's Introduction

RiotKit HealthFlux

Pushes information about healthchecks status into InfluxDB 1.8+/2.0+ basing on data from UptimeRobot service and Infracheck endpoints.

.github/img.png

Hardware requirements

  • CPU: 1vCPU (almost does not use CPU, any will be ok)
  • Memory: 64MB RAM
  • Disk space: 60MB (in docker 100 MB)

InfluxDB 1.8+ query

SELECT last("up_int") FROM "riothealthflux" WHERE $timeFilter GROUP BY "name" 

Metrics + example values

Usage with docker

    version: "2.4"
    services:
        healthflux:
            image: quay.io/riotkit/riothealthflux:3.0.0
            environment:
                INFLUXDB_URL: "http+influxdb://${INFLUXDB_USER}:${INFLUXDB_USER_PASSWORD}@influxdb:8086/${STATS_DB_NAME}"
                
                # list of providers, separated by ";"
                # Supported providers: Infracheck, UptimeRobot
                # 
                # Infracheck with a secret code:
                #     Infracheck://http://health.my-network.somewhere/infracheck-secret-code-there
                # 
                # Infracheck without secret code:
                #     Infracheck://http://health.my-network.somewhere/
                #
                # UptimeRobot (token you can generate in UptimeRobot web user interface in dashboard settings):
                #     UptimeRobot://your-token-there
                #
                RIOT_PROVIDERS: "UptimeRobot://aaaaa-bbbbbb;UptimeRobot://xxxx-yyyyyy;Infracheck://cccccc-ddddddd"
                
                # time interval in seconds how often to write data to InfluxDB
                # (consider fact that eg. UptimeRobot in free plan is running checks every 5 minutes. 
                #  Infracheck is open and free, and can run checks more often as you wish)
                SLEEP_TIME: "60"

                # allows to customize the measurement name that is pushed to the InfluxDB
                INFLUXDB_MEASUREMENT_NAME: "riothealthflux"

Usage without docker

Requirements:

  • PHP 8.0+
  • Composer
  • php-curl (PHP extension)
  • php-json (PHP extension)
composer install

export RIOT_PROVIDERS="Infracheck://http://127.0.0.1:8000;UptimeRobot://..." 
export INFLUXDB_URL="http+influxdb://bakunin:bakunin@localhost:8086/hulajpole"

# optional: Configure measurement name
export INFLUXDB_MEASUREMENT_NAME="riothealthflux"

# run each time you want to push the data to InfluxDB
# put it in a loop with a sleep, or schedule with a crontab
./bin/console background-process

Releasing

  1. Create a release in Github releases
  2. Wait for pipeline to build and publish to docker registry

Keywords

UptimeRobot to InfluxDB. Healthchecks in Grafana.

From authors

We are grassroot activists for social change, so we created RKD especially in mind for those fantastic initiatives:

Special thanks to Working Class History <https://twitter.com/wrkclasshistory>_ for very powerful samples that we could use in our unit tests.

riothealthflux's People

Contributors

blackandred avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

adleen

riothealthflux's Issues

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.