Environment preparation

Please refer to environment preparation

Meanwhile, please re-check current work directory setup:

export HOME=/home/work
export WORKSPACE=$HOME/open-falcon
mkdir -p $WORKSPACE

mail-provider & sms-provider

Once an alarm of accident occurred in the monitoring system, an alarm email or message needs to be sent. Every company may have their own mail provider, mail delivery method, SMS provider and message delivery method. In order to adapt to every company, falcon makes a standard message and mail delivery interface in access plan which needs every company to provide http.

Send http interface through sms:

method: post
params:
  - content: Message content
  - tos: Multiple mobile phone numbers separated by commas

falcon will invoke the interface in this way:

url=http message interface provided by your company
curl -X POST $url -d "content=xxx&tos=18611112222,18611112223"

Send http interdace through email:

method: post
params:
  - content: Email content
  - subject: Email subject
  - tos: Multiple email addresses separated by commas

falcon will invoke the interface in this way:

url=http email interface provided by your company
curl -X POST $url -d "content=xxx&tos=ulric.qin@gmail.com,user@example.com&subject=xxx"

sender

Invoke mail-providers and sms-providers provided by each company to read and send emails and messages in redis according to certain degree of concurrency. Alarm messages and emails generated in alarm will be just written into redis and sent by sender.

cd $WORKSPACE/sender/
mv cfg.example.json cfg.json
# vi cfg.json
# redis should use the same address with alarm and judge afterwords
# queue maintain default
# worker has the most delivery interfaces to invoke messages and emails
# api needs to provide interface addresses of sms-provider and mail-provider
./control start

fe

cd $WORKSPACE/fe/
mv cfg.example.json cfg.json
# Please modify related configuration items based on cfg.example.json properly

# activate 
./control start

# view logs
./control tail

# stop the service
./control stop

portal

portal is the place used for alarm policies configuration.

yum install -y python-virtualenv  # run as root

cd $WORKSPACE/portal/
virtualenv ./env

./env/bin/pip install -r pip_requirements.txt

# vi frame/config.py
# 1. Modify DB configuration
# 2. ECRET_KEY is set up as a random character string
# 3.  UIC_ADDRESS (there are two of them), internal network addresses configured as FE module, and portal normally is in the same network segment wit UIC
#    the mutual access among internal network addresses is fast. external is the UIC address visited by end users through browsers, which is quite important!
# 4. Other configurations can use default one

./control start

portal defaults monitor in port 5050, and can be visited just through browsers

HBS(Heartbeat Server)

Heartbeat Server only relies on the DB of Portal

cd $WORKSPACE/hbs/
mv cfg.example.json cfg.json
# vi cfg.json configure the database as the DB of portal
./control start

If drawing component is installed before alarm component, then agent should already have been installed. After hbs is launched, a http port and a rpc port will be monitored, agent will communicate with hbs, the configuration of agent named cfg.json will be modified again, enabled of heartbeat will be set as true, and configured with the rpc address of hbs, ./control restart agent will be restarted, then agent can be coordinated with hbs

judge

Alarm to judge the module, judgment relies on HBS, so HBS should be set up first

cd $WORKSPACE/judge/
mv cfg.example.json cfg.json
# vi cfg.json
# remain: the configuration specified the amount of judge internal storage for a certain data, for example the maximum value of cpu.idle for the machine of host01 can be stored in internal storage
# when configure alarm, for instance all (#3), the number after # can not exceed remain-1
# hbs: configured as the address of hbs, interval default is 60s, means every 60s a strategic
# alarm will be pulled from hbs: alarm event will be written into the redis configured in alarm, minInterval means the minimum seconds between every two alarms, maintaining the default will be OK
./control start

alarm

alarm module is set to handle alarm event, the alarm event generated by judge will be written into redis, alarm will read in redis, the module is in a mess by operation, you can re-write according to your own needs

cd $WORKSPACE/alarm/
mv cfg.example.json cfg.json
# vi cfg.json
# configures redis as the same one with judge

./control start

Please notice that with the current version of alarm, highQueues and lowQueues cannot be empty, it is a bug which will be fixed later. We can configure event:p0~event:p5 in highQueues, and event:p6 in lowQueues.

Alarm merging

In the situation of default, Open-Falcon does not open the alarm merging function. If the function needs to be opened, please refer to: alarm merging configuration

Copyright © 2017 FalconPlus Community all right reserved,powered by Gitbook该文件修订时间: 2017-10-31 11:08:03