simple url monitoring tool
Go Makefile
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
img
test
tmp
.codeclimate.yml
.env.example
.gitignore
.travis.yml
LICENSE
Makefile
README.md
VERSION
chatwork_notifier.go
chatwork_notifier_test.go Refactor: use pointer instead of value Jun 5, 2016
config.go
config_test.go
lock.json
main.go
main_test.go
manifest.json
notifier.go
slack_notifier.go Notify responseTime Sep 27, 2016
slack_notifier_test.go
status_store.go
status_store_test.go
util.go
util_test.go

README.md

Zatsu(雑) Monitor

zatsu_monitor is simple url monitoring tool

Notify message to chatroom only if http status is changed from just before (e.g. 500 -> 200)

slack

Build Status Coverage Status Code Climate

Getting

Download latest binary from here

https://github.com/sue445/zatsu_monitor/releases

Usage

/path/to/zatsu_monitor -config /path/to/config.yml -data /path/to/data_dir
  • -config: Path to config yaml file (see after)
  • -data: Cache dir. latest http status is stored to here

Help

$ ./zatsu_monitor --help
Usage of ./zatsu_monitor:
  -config string
        Path to config file
  -data string
        Path to data dir for cache
  -version
        Whether showing version

Config yaml file format

Example

# zatsu_monitor.yml
google:
  type: slack
  check_url: "https://www.google.com/"
  api_token: "AAAAAAAA"
  channel: "#general"
  user_name: "zatsu_monitor"
  # check_only_top_of_status_code: true
github:
  type: chatwork
  check_url: "https://github.com/"
  api_token: "AAAAAAAA"
  room_id: "111111"
  # check_only_top_of_status_code: true

Detail

zatsu_monitor supports some notifier

Slack

  • type : slack (fixed value)
  • check_url : URL for checking (required)
  • api_token : Slack API Token (required)
  • channel : Channel for post (required)
  • user_name : Name for post (optional. default is zatsu_monitor)

ChatWork

  • type : chatwork (fixed value)
  • check_url : URL for checking (required)
  • api_token : ChatWork API Token (required)
  • room_id : RoomID for post (required)

Common

  • check_only_top_of_status_code : Whether check only top of the status code (optional. default is false)
    • e.g) When check_only_top_of_status_code is true, before status code is 501 and current status code is 502, don't notify

ProTip

Inherit values

slack: &common
  type: slack
  channel: "#general"
  api_token: "xoxp-0000000000-0000000000-0000000000-000000"

github:
  # inherit common values
  <<: *common

  # override common values
  check_url: "https://github.com/"
  chennel: "#github"

google:
  <<: *common
  check_url: "https://www.google.com/"
  chennel: "#google"

Development

Setup

go get -u ./...
go get -u -t ./...
cp .env.example .env
vi .env