small and smart service monitor, written in golang
Go Shell
Latest commit 636a998 Oct 22, 2016 @niean committed on GitHub Update README.md
Permalink
Failed to load latest commit information.
g use pfc, rm vg Mar 16, 2016
http use pfc, rm vg Mar 16, 2016
monitor use pfc, rm vg Mar 16, 2016
test use pfc, rm vg Mar 16, 2016
.gitignore use pfc, rm vg Mar 16, 2016
README.md Update README.md Oct 22, 2016
cfg.example.json fmt import path, modify control and debug scripts Aug 24, 2015
control use pfc, rm vg Mar 16, 2016
main.go use pfc, rm vg Mar 16, 2016
perfcounter.json use pfc, rm vg Mar 16, 2016

README.md

anteye

anteye is a small and simple monitor system. anteye should monitor cluster less then 50 instances. it can send notice msgs via mailsms or callback(TODO).
we suggest you deploy more than one anteye instances in the production environment.

install

You can install anteye from the latest release,

# download release
wget -q https://github.com/niean/anteye/releases/download/v0.0.2/tycs-anteye-0.0.2.tar.gz
tar -zxf tycs-anteye-$vsn.tar.gz

# config, change configs as you like
mv cfg.example.json cfg.json
vim cfg.json
...

# start
./control start

# stop
./control stop

Or you can install anteye from scratch

# download src
cd $GOPATH/src/github.com/niean
git clone https://github.com/niean/anteye.git
cd anteye
go get ./...

# build, get bin tycs-anteye
./control build

# config, change configs as you like
mv cfg.example.json cfg.json
vim cfg.json
...

# start
./control start

# stop
./control stop

config

debug: true/false, open debug log or not

http
    - enable: true/false, enable http-server or not
    - listen: listening port of http-server

mail 
    - enable: true/false, enable sending alarm mails or not
    - url: http-url used to post mail content
    - receivers: mail accounts. if you have multiple accounts, then separate them by commas. eg. "a@gmail.com,b@yahoo.com"

sms
    - enable: true/false, enable sending alarm sms or not
    - url: http-url used to post sms content
    - receivers: mobile numbers. if you have multiple numbers, then separate them by commas. eg. "18001163876,13811685233"

callback
    - enable: true/false, enable alarm callback or not
    - url: http-url used to post alarm content

monitor
    - cluster: host instances to be monitored, one item goes like "module,hostname:port/health/url"

interface

anteye sends msgs via http interfaces. these interfaces defined as followings:

# sms interface
method: http.post
params:
  - tos: mobile numbers separated by commas
  - content: content of sms
  - from: optional, indicates who sends this sms 

# mail interface
method: http.post
params:
  - tos: mail accounts separated by commas
  - content: content of mail
  - subject: subject of mail
  - from: optional, indicates who sends this mail

# callback
method: http.post
params: body. anteye will post you a string object like '[date][status][err.cnt][instance]', eg. [2015-07-02 08:40:30][err][8][task,127.0.0.1:16269/health]

debug

# log
./test/debug tail

# get internal status
./test/debug counter

reference