Giter VIP home page Giter VIP logo

check_prometheus's Introduction

Circle CI Go Report Card License: GPL v3

check_prometheus

Monitoring Plugin to check the health of a Prometheus server and its data

Usage

Global Options

$ check_prometheus -h
NAME:
   check_prometheus - Checks different prometheus stats as well the data itself
   Copyright (c) 2017 Philip Griesbacher
   https://github.com/Griesbacher/check_prometheus

USAGE:
   check_prometheus [global options] command [command options] [arguments...]

VERSION:
   0.0.1

COMMANDS:
     mode, m  check mode
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   -t value       Seconds till check returns unknown, 0 to disable (default: 10)
   -f value       If the checked data is older then this in seconds, unknown will be returned. Set to 0 to disable. (default: 300)
   --help, -h     show help
   --version, -v  print the version

Command options

$ check_prometheus mode -h
   NAME:
      check_prometheus mode - check mode
   
   USAGE:
      check_prometheus mode command [command options] [arguments...]
   
   COMMANDS:
        ping, p         Returns the build informations
        query, q        Checks collected data
        targets_health  Returns the health of the targets
   
   OPTIONS:
      --help, -h  show help

Subcommand options example

$ check_prometheus mode query -h
NAME:
   check_prometheus mode query - Checks collected data

USAGE:
   check_prometheus mode query [command options] [arguments...]

DESCRIPTION:
   Your Promqlquery has to return a vector / scalar / matrix result. The warning and critical values are applied to every value.
   Examples:
       Vector:
           check_prometheus mode query -q 'up'
       --> OK - Query: 'up'|'up{instance="192.168.99.101:9245", job="iapetos"}'=1;;;; 'up{instance="0.0.0.0:9091", job="prometheus"}'=1;;;;

       Scalar:
           check_prometheus mode query -q 'scalar(up{job="prometheus"})'
       --> OK - OK - Query: 'scalar(up{job="prometheus"})' returned: '1'|'scalar'=1;;;;

       Matrix:
           check_prometheus mode query -q 'http_requests_total{job="prometheus"}[5m]'
       --> OK - Query: 'http_requests_total{job="prometheus"}[5m]'

       Search and Replace:
           check_prometheus m query -q 'up' --search '.*job=\"(.*?)\".*' --replace '$1'
       --> OK - Query: 'up'|'prometheus'=1;;;; 'iapetos'=0;;;;

           check_prometheus m q -q '{handler="prometheus",quantile="0.99",job="prometheus",__name__=~"http_.*bytes"}' --search '.*__name__=\"(.*?)\".*' --replace '$1' -a 'http_in_out'
       --> OK - Alias: 'http_in_out'|'http_request_size_bytes'=296;;;; 'http_response_size_bytes'=5554;;;;

OPTIONS:
   --address value  Prometheus address: Protocol + IP + Port. (default: "http://localhost:9100")
   -q value         Query to be executed
   -a value         Alias, will replace the query within the output, if set
   -w value         Warning value. Use nagios-plugin syntax here.
   -c value         Critical value. Use nagios-plugin syntax here.
   --search value   If this variable is set, the given Golang regex will be used to search and replace the result with the 'replace' flag content. This will be appied on the perflabels.
   --replace value  See search flag. If the 'search' flag is empty this flag will be ignored.

check_prometheus's People

Contributors

griesbacher avatar zicklam 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.