Giter Club home page Giter Club logo

alarm's Introduction

falcon-alarm

judge把报警event写入redis,alarm从redis读取event,做相应处理,可能是发报警短信、邮件,可能是callback某个http地址。 生成的短信、邮件写入queue,sender模块专门负责来发送。

Installation

# set $GOPATH and $GOROOT
mkdir -p $GOPATH/src/github.com/open-falcon
cd $GOPATH/src/github.com/open-falcon
git clone https://github.com/open-falcon/alarm.git
cd alarm
go get ./...
./control build
./control start

Configuration

  • uicToken: 留空即可
  • http: 监听的http端口
  • queue: 要发送的短信、邮件写入的队列,需要与sender配置一致
  • redis: highQueues和lowQueues区别是是否做报警合并,默认配置是P0/P1不合并,收到之后直接发出;>=P2做报警合并
  • api: 其他各个组件的地址

Create Event Table

  • use falcon_portal
CREATE TABLE event_cases (
        id VARCHAR(50),
        endpoint VARCHAR(100) NOT NULL,
        metric VARCHAR(200) NOT NULL,
        func VARCHAR(50),
        cond VARCHAR(200) NOT NULL,
        note VARCHAR(200),
        max_step int(10) unsigned,
        current_step int(10) unsigned,
        priority INT(6) NOT NULL,
        status VARCHAR(20) NOT NULL,
        timestamp Timestamp NOT NULL,
        update_at Timestamp,
        process_note MEDIUMINT,
        process_status VARCHAR(20),
        tpl_creator VARCHAR(64),
        expression_id int(10) unsigned,
        strategy_id int(10) unsigned,
        template_id int(10) unsigned,
        PRIMARY KEY (id),
        INDEX (endpoint, strategy_id, template_id)
);

CREATE TABLE events (
  id MEDIUMINT NOT NULL AUTO_INCREMENT,
  event_caseId VARCHAR(50),
  step int(10) unsigned,
  cond VARCHAR(200) NOT NULL,
  status  int(3) unsigned DEFAULT 0,
  timestamp Timestamp,
  PRIMARY KEY (id),
  INDEX(event_caseId),
  FOREIGN KEY (event_caseId) REFERENCES event_cases(id)
    ON DELETE CASCADE
    ON UPDATE CASCADE
);

CREATE TABLE event_note (
  id MEDIUMINT NOT NULL AUTO_INCREMENT,
  event_caseId VARCHAR(50),
  note    VARCHAR(300),
  case_id VARCHAR(20),
  status VARCHAR(15),
  timestamp Timestamp,
  user_id int(10) unsigned,
  PRIMARY KEY (id),
  INDEX (event_caseId),
  FOREIGN KEY (event_caseId) REFERENCES event_cases(id)
    ON DELETE CASCADE
    ON UPDATE CASCADE,
  FOREIGN KEY (user_id) REFERENCES uic.user(id)
    ON DELETE CASCADE
    ON UPDATE CASCADE
);

alarm's People

Contributors

hitripod avatar masato25 avatar crosserclaws avatar ulricqin avatar myhung avatar laiwei avatar chuanxd avatar niean avatar

Watchers

James Cloos avatar  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.