GithubHelp home page GithubHelp logo

rmeira / go-http-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paulsec/go-http-monitor

0.0 0.0 0.0 18 KB

A (dead-simple) Golang utility allowing you to monitor HTTP endpoints

Go 93.65% Dockerfile 6.35%

go-http-monitor's Introduction

Go-mon

This small utility is dead simple and will allow you to monitor HTTP endpoints, and easily pluggable in the CI. Everything is configurable through a YAML file (monitor.yml) and looks like this:

insecure: false
timeout_seconds: 5
checks:
  - url: "https://www.cfptime.org"
    status_code: 200
    match: "Loading"
    response_time: 210
  - url: "https://shodan.io/"
    status_code: 200
    match: "the Internet of Things"

Options

Option What does it mean
insecure Skip SSL/TLS verification (in case of self-signed certificates, ..)
timeout_seconds How long you'd like to wait for the HTTP request
checks A list of all the checks you'd like to perform
checks > url The URL you want to monitor
checks > status_code The status code you expect
checks > match One string you're looking for on the webpage

Usage

In order to launch it, just build it and run it this way:

$ go build main.go && ./main
[OK] https://www.cfptime.org
[OK] https://shodan.io/
$ echo $?
0

If you add another check that will obviously fail:

  - url: "https://urlthatdoesnotexist.foobar"
    status_code: 500
    match: "the Internet of Things"

Resulting output will be:

$ ./main
[OK] https://www.cfptime.org
[OK] https://shodan.io/
[NOK] https://urlthatdoesnotexist.foobar
$ echo $?
1

Contributing

Feel free to fork the project and do whatever you want with it.

go-http-monitor's People

Contributors

paulsec avatar jeorjebot 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.