Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected.

Overview

StatusOK

Monitor your Website and APIs from your computer.Get notified through Slack or E-mail when your server is down or response time is more than expected.

Simple Version

Simple Setup to monitor your website and recieve a notification to your Gmail when your website is down.

Step 1: Write a config.json with the url information

{
	"notifications":{
		"mail":{
			"smtpHost":"smtp.gmail.com",
			"port":587,
			"username":"[email protected]",
			"password":"your gmail password",
			"from":"[email protected]",
			"to":"[email protected]"
		}
	},
	"requests":[
		{
			"url":"http://mywebsite.com",
			"requestType":"GET",
			"checkEvery":30,	
			"responseTime":800
		}
	]
}

Turn on access for your gmail https://www.google.com/settings/security/lesssecureapps .

Step 2: Download bin file from here and run the below command from your terminal

$ ./statusok --config config.json

Thats it !!!! You will receive a mail when your website is down or response time is more.

To run as background process add & at the end

$ ./statusok --config config.json &	

to stop the process

$ jobs
$ kill %jobnumber

Complete Version using InfluxDb

alt text

You can save data to influx db and view response times over a period of time as above using graphana.

Guide to install influxdb and grafana

With StatusOk you can monitor all your REST APIs by adding api details to config file as below.A Notification will be triggered when you api is down or response time is more than expected.

{
	"url":"http://mywebsite.com/v1/data",
	"requestType":"POST",
	"headers":{
		"Authorization":"Bearer ac2168444f4de69c27d6384ea2ccf61a49669be5a2fb037ccc1f",
		"Content-Type":"application/json"
	},
	"formParams":{
		"description":"sanath test",
		"url":"http://google.com"
	},
	"checkEvery":30,
	"responseCode":200,		
	"responseTime":800
},

{
	"url":"http://mywebsite.com/v1/data",
	"requestType":"GET",
	"headers":{
		"Authorization":"Bearer ac2168444f4de69c27d6384ea2ccf61a49669be5a2fb037ccc1f",		
	},
	"urlParams":{
		"name":"statusok"
	},
	"checkEvery":300,
	"responseCode":200,		
	"responseTime":800
},

{
	"url":"http://something.com/v1/data",
	"requestType":"DELETE",
	"formParams":{
		"name":"statusok"
	},
	"checkEvery":300,
	"responseCode":200,		
	"responseTime":800
}

Guide to write config.json file

Sample config.json file

To run the app

$ ./statusok --config config.json &

Database

Save Requests response time information and error information to your database by adding database details to config file. Currently only Influxdb 0.9.3+ is supported.

You can also add data to your own database.view details

Notifications

Notifications will be triggered when mean response time is below given response time for a request or when an error is occured . Currently the below clients are supported to receive notifications.For more information on setup click here

  1. Slack
  2. Smtp Email
  3. Mailgun
  4. Http EndPoint
  5. Dingding

Adding support to other clients is simple.view details

Running with plain Docker

docker run -d -v /path/to/config/folder:/config sanathp/statusok

Note: Config folder should contain config file with name config.json

Running with Docker Compose

Prepare docker-compose.yml config like this:

version: '2'
services:
  statusok:
    build: sanathp/statusok
    volumes:
      - /path/to/config/folder:/config
    depends_on:
      - influxdb
  influxdb:
    image: tutum/influxdb:0.9
    environment:
      - PRE_CREATE_DB="statusok" 
    ports:
      - 8083:8083 
      - 8086:8086
  grafana:
    image: grafana/grafana
    ports:
      - 3000:3000

Now run it:

docker-compose up

Contribution

Contributions are welcomed and greatly appreciated. Create an issue if you find bugs. Send a pull request if you have written a new feature or fixed an issue .Please make sure to write test cases.

License

Copyright 2015 Sanath Kumar Pasumarthy

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
Comments
  • Better support for Docker

    Better support for Docker

    • image is now ready to be uploaded to Docker Hub;
    • InfluxDb and Grafana removed to follow Docker best practices. See https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#/run-only-one-process-per-container for more info;
    • README updated with docker and docker-compose examples;
    opened by wildsurfer 8
  • Mailgun Notification service is breaking the install/build

    Mailgun Notification service is breaking the install/build

    When trying to install/build there was an error with the MailGun notification service. After reviewing, it looks like the Mailgun service no longer requires a public key to be passed (just domain and private key). I put through a pull request that adheres to the new requirements of the Mailgun v2 API: https://github.com/sanathp/statusok/pull/40

    opened by rmorrison61 2
  • i/o timeout

    i/o timeout

    Hello,

    when i set the statusOk program running, i get a lot off the following errors:
    dial tcp <hostip>: i/o timeout & net/http: TLS handshake timeout

    i have looked around and most of the results are about DNS and / or Networking but both seem to be fine..
    do you have a tip for where to look to solve this error?

    opened by rohimma 2
  • I have issue with influxdb

    I have issue with influxdb

    It seems like influxdb+Grafana integration does not work. db connection is working.

    config.json

    {
    "database":{
            "influxDb":{
                "host":"localhost",
                "port":8086,
                "databaseName":"statusok",
                "username":"",
                "password":""
            }
    },
        "requests":[
            {
                "url":"https://camva.ir",
                "requestType":"GET",
                "checkEvery":30,
                "responseTime":800
            }
        ]
    }
    

    I checked the db. data is being logged.

    opened by hadifarnoud 2
  • Unable to run application, timeout error when trying to connect to stmp or slack or any type of service

    Unable to run application, timeout error when trying to connect to stmp or slack or any type of service

    Hi Guys, really need to get this working, however it does not connect with slack or smtp, it always times out, here is the error i get with slack : Post https://hooks.slack.com/services/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: dial tcp 54.192.157.142:443: i/o timeout

    im not sure where this address: 54.192.157.142:443 is coming from..

    Appreciate your help, thanks.

    opened by genesiscrew 1
  • use the lower-case logrus package import path

    use the lower-case logrus package import path

    use the lower-case logrus package import path: github.com/sirupsen/logrus according to logrus author's advice.

    And this change also makes the statusok compatible with go 1.11(and later version) building using go modules mechanism. otherwise, some error like below will occur:

    go: github.com/Sirupsen/[email protected]: parsing go.mod: unexpected module path "github.com/sirupsen/logrus" go: error loading module requirements

    opened by bigwhite 0
  • Update Config.md

    Update Config.md

    BTW: Here is my post request body: {"data": [{"password": "xxx", "email": "xxx"}]} image

    I tried to config in this way: image

    But failed and got this error: image

    opened by daya0576 0
  • x509: certificate signed by unknown authority Erro when running inside docker

    x509: certificate signed by unknown authority Erro when running inside docker

    I am using the dockerfile provided in the repository, with the following configuration "mail": { "smtpHost": "smtp.gmail.com", "port": 587, "username": "[email protected]", "password": "XXXXX", "from": "XX[email protected]", "to": "[email protected]" }

    when I run docker image I have this output

    Reading File : /config/config.json Initializing Notification Clients.... Notifications : Smtp Mail Intialized Sending Test notifications to the registered clients Failed to Send Response Time notification to Smtp Mail Please check the details entered in the config file Error Details : x509: certificate signed by unknown authority

    I tried to install ca-certicates and update the certifcates but I still have the same error

    FROM golang:1.6.3
    
    ENV STATUSOK_VERSION 0.1.1
    
    RUN apt-get update \
        && apt-get install -y unzip  ca-certificates  \
        && wget https://github.com/sanathp/statusok/releases/download/$STATUSOK_VERSION/statusok_linux.zip \
        && unzip statusok_linux.zip \
        && mv ./statusok_linux/statusok /go/bin/StatusOk \
        && rm -rf ./statusok_linux* \
        && apt-get remove -y unzip git \
        && apt-get autoremove -y \
        && apt-get clean \
        && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
    
    ENV TZ=Europe/Berlin
    
    
    RUN  update-ca-certificates -f ;
    
    VOLUME /config
    COPY ./docker-entrypoint.sh /docker-entrypoint.sh
    ENTRYPOINT ["sh", "/docker-entrypoint.sh"]
    
    opened by iteahmad 1
  • Requests configuration and invocation with body complex JSON and XML SOAP pattern

    Requests configuration and invocation with body complex JSON and XML SOAP pattern

    Hello! I needed call API and Web Services SOAP, using complex type, cause that I created 2 properties in configuration file requests area.

    Bests,

    Alex

    opened by alexandercamps 0
  • Sends emails with incorrect headers

    Sends emails with incorrect headers

    Email notifications are sent with incorrect headers causing them to be blocked by most major email services (Google etc)

    Can be fixed by adding a valid from and subject to email message

    example:

    550-5.7.1 [216.92.131.252      11] Our system has detected that this
    message is 550-5.7.1 not RFC 5322 compliant: 550-5.7.1 'From' header is
    missing. 550-5.7.1 To reduce the amount of spam sent to Gmail, this message
    has been 550-5.7.1 blocked. Please visit 550-5.7.1
    https://support.google.com/mail/?p=RfcMessageNonCompliant 550 5.7.1 and
    review RFC 5322 specifications for more information. h20si4460693qvw.81 -
    gsmtp (in reply to end of DATA command)
    
    opened by anteatersa 0
  • add new Feature for response body contains String

    add new Feature for response body contains String

    new feature contains(or not contains)

    config.json

    ... "requests":[ { "url":"http://localhost:5500", "requestType":"GET", "headers":{ }, "params":{ }, "checkEvery":5, "responseCode":200, "responseTime":800, "checkResponseBody" : { "checkType" : "contains", "matchFor" : "some String" } } ] ...

    chechType can be "contains" or "notContains". If it is "contains", it is judged as an error if the response does not contain the string specified as "matchFor". else it is "notContains" it works as expected.

    opened by lmiz2 0
  • Cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal

    Cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal

    We try to build source, I got this error:

    $ go build
    # ~/statusok
    ./statusok.go:40:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
    	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
    ./statusok.go:45:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
    	cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
    ./statusok.go:52:13: cannot use func literal (type func(*cli.Context)) as type cli.ActionFunc in assignment
    
    opened by pokapow 1
Releases(0.1.1)
Owner
Sanath Kumar
Sanath Kumar
Andrews-monitor - A Go program to monitor when times were available to order for Brown's Andrews dining hall. Used during the portion of the pandemic when the dining hall was only available for online order.

Andrews Dining Hall Monitor A Go program to monitor when times were available to order for Brown's Andrews dining hall. Used during the portion of the

null 0 Jan 1, 2022
Automated-gke-cilium-networkpolicy-demo - Quickly provision and tear down a GKE cluster with Cilium enabled for working with Network Policy.

Automated GKE Network Policy Demo Before running the automation, make sure you have the correct variables in env-automation/group_vars/all.yaml. There

Casey Wylie 0 Jan 1, 2022
ip-masq-agent-v2 aims to solve more specific networking cases, allow for more configuration options, and improve observability compared to the original.

ip-masq-agent-v2 Based on the original ip-masq-agent, v2 aims to solve more specific networking cases, allow for more configuration options, and impro

Microsoft Azure 5 Aug 31, 2022
A build tool from space, down on earth.

Bob Inspired by Make and Bazel · Made for humans Bob is a build system, a task runner as well as tooling for Git Multi-repos, all bundled into a singl

benchkram 230 Jan 4, 2023
Automatically power off system when network interface is down

passer A tiny tool can automatically power off system when network interface is

Zongzi 0 Apr 23, 2022
OCI transport plugin for apt-get (i.e., apt-get over ghcr.io)

apt-transport-oci: OCI transport plugin for apt-get (i.e., apt-get over ghcr.io) apt-transport-oci is an apt-get plugin to support distributing *.deb

Akihiro Suda 88 Nov 1, 2022
gpu-memory-monitor is a metrics server for collecting GPU memory usage of kubernetes pods.

gpu-memory-monitor is a metrics server for collecting GPU memory usage of kubernetes pods. If you have a GPU machine, and some pods are using the GPU device, you can run the container by docker or kubernetes when your GPU device belongs to nvidia. The gpu-memory-monitor will collect the GPU memory usage of pods, you can get those metrics by API of gpu-memory-monitor

null 2 Jul 27, 2022
IC-Go: Go Agent for the Internet Computer

IC-Go: Go Agent for the Internet Computer Here is the beta version of go agent f

MixLabs 20 Dec 14, 2022
CPU usage percentage is the ratio of the total time the CPU was active, to the elapsed time of the clock on your wall.

Docker-Kubernetes-Container-CPU-Utilization Implementing CPU Load goroutine requires the user to call the goroutine from the main file. go CPULoadCalc

Ishank Jain 1 Dec 15, 2021
Kubedock is a minimal implementation of the docker api that will orchestrate containers on a Kubernetes cluster, rather than running containers locally.

Kubedock Kubedock is an minimal implementation of the docker api that will orchestrate containers on a kubernetes cluster, rather than running contain

Vincent van Dam 79 Nov 11, 2022
A minimal Go project with user authentication ready out of the box. All frontend assets should be less than 100 kB on every page load

Golang Base Project A minimal Golang project with user authentication ready out of the box. All frontend assets should be less than 100 kB on every pa

Markus Tenghamn 239 Jan 1, 2023
A watchdog for Kubernetes rolebindings. Barks (Slack notifications) when something is happening on your front porch.

Cave canem - Beware of the dog A fun little application that acts as a watchdog for Kubernetes rolebindings. If something happens on the front porch i

Simon Zengerling 3 Jan 7, 2023
🏯 Monitor your (gitlab/github) CI/CD pipelines via command line interface with fortress

__ _ / _| | | | |_ ___ _ __| |_ _ __ ___ ___ ___ | _/ _ \| '__| __| '__/ _ \/ __/ _

MrJosh 6 Mar 31, 2022
Latest block exporter to monitor your own nodes !

Ethereum Block Prometheus Exporter Deeply copied from 31z4/ethereum-prometheus-exporter Thanks a lot for his work ! This service exports the latest bl

iderr 0 Nov 5, 2021
A middleware plugin for Traefik which replace a header in the response

Rewrite Header Rewrite header is a middleware plugin for Traefik which replace a header in the response Configuration Static pilot: token: "xxxx" e

vincentinttsh 1 Feb 11, 2022
AWS Cloudtrail event alerting lambda function. Send alerts to Slack, Email, or SNS.

Cloudtrail-Tattletail is a Lambda based Cloudtrail alerting tool. It allows you to write simple rules for interesting Cloudtrail events and forward those events to a number of different systems.

Peter Sanford 19 Jan 6, 2023
Slack Incoming Webhook for Go

Slack Incoming Webhook for Go Installation go get github.com/loyalid/slack-incoming-webhook-go Usage import "github.com/loyalid/slack-incoming-webhook

null 1 Oct 28, 2021
Terraform provider for Slack's App Manifest API

Terraform Provider Scaffolding (Terraform Plugin SDK) This template repository is built on the Terraform Plugin SDK. The template repository built on

Matthew de la Rosa 0 Jan 9, 2022