zatsu_monitor

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 12 Imported by: 0

README

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

Latest Version Build Status Code Climate Go Report Card

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"
  # or
  # webhook_url: "https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXX"

  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 (either api_token or webhook_url is required)
  • webhook_url : Slack Incoming Webhook URL (either api_token or webhook_url is 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"
  # or
  # webhook_url: "https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXX"

github:
  # inherit common values
  <<: *common

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

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

Development

Setup
cp .env.example .env
vi .env

Changelog

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL