openfalcon-0.2 配置

 

 

 

 

hbs 配置文件



{
    "debug": true,
    "database": "openfalcon:123456@tcp(172.16.230.188:3306)/falcon_portal?loc=Local&parseTime=true",
    "hosts": "",
    "maxIdle": 100,
    "listen": ":6030",
    "trustable": [""],
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:6031"
    }
}

 

 

transfer配置文件

{
"debug": true, "minStep": 30, "http": { "enabled": true, "listen": "0.0.0.0:6060" }, "rpc": { "enabled": true, "listen": "0.0.0.0:8433" }, "socket": { "enabled": true, "listen": "0.0.0.0:4444", "timeout": 3600 }, "judge": { "enabled": true, "batch": 200, "connTimeout": 1000, "callTimeout": 5000, "maxConns": 32, "maxIdle": 32, "replicas": 500, "cluster": { "judge-00" : "172.16.230.183:6080", "judge-01" : "172.16.230.184:6080" } }, "graph": { "enabled": true, "batch": 200, "connTimeout": 1000, "callTimeout": 5000, "maxConns": 32, "maxIdle": 32, "replicas": 500, "cluster": { "graph-00" : "172.16.230.185:6070", "graph-01" : "172.16.230.186:6070" } }, "tsdb": { "enabled": false, "batch": 200, "connTimeout": 1000, "callTimeout": 5000, "maxConns": 32, "maxIdle": 32, "retry": 3, "address": "127.0.0.1:8088" } }

 

judge配置文件


{
    "debug": true,
    "debugHost": "nil",
    "remain": 11,
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:6081"
    },
    "rpc": {
        "enabled": true,
        "listen": "0.0.0.0:6080"
    },
    "hbs": {
        "servers": ["172.16.230.180:6030"],
        "timeout": 300,
        "interval": 60
    },
    "alarm": {
        "enabled": true,
        "minInterval": 300,
        "queuePattern": "event:p%v",
        "redis": {
            "dsn": "172.16.230.187:6379",
            "maxIdle": 5,
            "connTimeout": 5000,
            "readTimeout": 5000,
            "writeTimeout": 5000
        }
    }
}
graph 配置文件


{
        "debug": false,
        "http": {
                "enabled": true,
                "listen": "0.0.0.0:6071"
        },
        "rpc": {
                "enabled": true,
                "listen": "0.0.0.0:6070"
        },
        "rrd": {
                "storage": "/data/monitor/graph/data"
        },
        "db": {
                "dsn": "openfalcon:123456@tcp(172.16.230.188:3306)/graph?loc=Local&parseTime=true",
                "maxIdle": 4
        },
        "callTimeout": 5000,
        "migrate": {
                "enabled": false,
                "concurrency": 2,
                "replicas": 500,
                "cluster": {
                        "graph-00" : "172.16.230.185:6070",
                        "graph-01" : "172.16.230.185:6070"
                }
        }
}

 

api 配置文件

{
        "log_level": "debug",
        "db": {
                "faclon_portal": "openfalcon:123456@tcp(172.16.230.188:3306)/falcon_portal?charset=utf8&parseTime=True&loc=Local",
                "graph": "openfalcon:123456@tcp(172.16.230.188:3306)/graph?charset=utf8&parseTime=True&loc=Local",
                "uic": "openfalcon:123456@tcp(172.16.230.188:3306)/uic?charset=utf8&parseTime=True&loc=Local",
                "dashboard": "openfalcon:123456@tcp(172.16.230.188:3306)/dashboard?charset=utf8&parseTime=True&loc=Local",
                "alarms": "openfalcon:123456@tcp(172.16.230.188:3306)/alarms?charset=utf8&parseTime=True&loc=Local",
                "db_bug": true
        },
        "graphs": {
                "cluster": {
                        "graph-00": "172.16.230.185:6070",
                        "graph-01": "172.16.230.186:6070"
                },
                "max_conns": 100,
                "max_idle": 100,
                "conn_timeout": 1000,
                "call_timeout": 5000,
                "numberOfReplicas": 500
        },
        "metric_list_file": "./api/data/metric",
        "web_port": "0.0.0.0:8080",
        "access_control": true,
        "signup_disable": false,
        "salt": "",
        "skip_auth": false,
        "default_token": "default-token-used-in-server-side",
        "gen_doc": false,
        "gen_doc_path": "doc/module.html"
}
~                   

 

 

dashboard配置文件

#-*-coding:utf8-*-
# app config
import os
LOG_LEVEL = os.environ.get("LOG_LEVEL",'DEBUG')
SECRET_KEY = os.environ.get("SECRET_KEY","secret-key")
PERMANENT_SESSION_LIFETIME = os.environ.get("PERMANENT_SESSION_LIFETIME",3600 * 24 * 30)
SITE_COOKIE = os.environ.get("SITE_COOKIE","open-falcon-ck")

# Falcon+ API
API_ADDR = os.environ.get("API_ADDR","http://172.16.230.189:8080/api/v1")

# portal database
# TODO: read from api instead of db
PORTAL_DB_HOST = os.environ.get("PORTAL_DB_HOST","172.16.230.188")
PORTAL_DB_PORT = int(os.environ.get("PORTAL_DB_PORT",3306))
PORTAL_DB_USER = os.environ.get("PORTAL_DB_USER","openfalcon")
PORTAL_DB_PASS = os.environ.get("PORTAL_DB_PASS","123456")
PORTAL_DB_NAME = os.environ.get("PORTAL_DB_NAME","falcon_portal")

# alarm database
# TODO: read from api instead of db
ALARM_DB_HOST = os.environ.get("ALARM_DB_HOST","172.16.230.188")
ALARM_DB_PORT = int(os.environ.get("ALARM_DB_PORT",3306))
ALARM_DB_USER = os.environ.get("ALARM_DB_USER","openfalcon")
ALARM_DB_PASS = os.environ.get("ALARM_DB_PASS","123456")
ALARM_DB_NAME = os.environ.get("ALARM_DB_NAME","alarms")

# ldap config
LDAP_ENABLED = os.environ.get("LDAP_ENABLED",False)
LDAP_SERVER = os.environ.get("LDAP_SERVER","ldap.forumsys.com:389")
LDAP_BASE_DN = os.environ.get("LDAP_BASE_DN","dc=example,dc=com")
LDAP_BINDDN_FMT = os.environ.get("LDAP_BINDDN_FMT","uid=%s,dc=example,dc=com")
LDAP_SEARCH_FMT = os.environ.get("LDAP_SEARCH_FMT","uid=%s")
LDAP_ATTRS = ["cn","mail","telephoneNumber"]
LDAP_TLS_START_TLS = False
LDAP_TLS_CACERTDIR = ""
LDAP_TLS_CACERTFILE = "/etc/openldap/certs/ca.crt"
LDAP_TLS_CERTFILE = ""
LDAP_TLS_KEYFILE = ""
LDAP_TLS_REQUIRE_CERT = True
LDAP_TLS_CIPHER_SUITE = ""

# i18n
BABEL_DEFAULT_LOCALE   = 'zh_CN'
BABEL_DEFAULT_TIMEZONE = 'Asia/Shanghai'
# aviliable translations
LANGUAGES   = {
    'en':  'English',
    'zh_CN':  'Chinese-Simplified',
}

# portal site config
MAINTAINERS = ['root']
CONTACT = 'root@open-falcon.org'

try:
    from rrd.local_config import *
except:
    print "[warning] no local config file"

  

172.16.230.191 包含了 alarm send mail_provider   nodata  task  aggregator agent  chat

[root@openfalcon_alarm_sender config]# vim cfg.json

{
    "log_level": "debug",
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:9912"
    },
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:9912"
    },
    "redis": {
        "addr": "172.16.230.187:6379",
        "maxIdle": 5,
        "highQueues": [
            "event:p0",
            "event:p1",
            "event:p2"
        ],
        "lowQueues": [
            "event:p3",
            "event:p4",
            "event:p5",
            "event:p6"
        ],
        "userIMQueue": "/queue/user/im",
        "userSmsQueue": "/queue/user/sms",
        "userMailQueue": "/queue/user/mail"
    },
    "api": {
        "im": "http://172.16.230.191:4567/send",
        "sms": "http://127.0.0.1:10086/sms",
        "mail": "http://172.16.230.191:4000/sender/mail",
        "dashboard": "http://172.16.230.190:80",
        "plus_api":"http://172.16.230.189:8080",
        "plus_api_token": "default-token-used-in-server-side"
    },
    "falcon_portal": {
        "addr": "openfalcon:123456@tcp(172.16.230.188:3306)/alarms?charset=utf8&loc=Asia%2FChongqing",
        "idle": 10,
        "max": 100
    },
    "worker": {
        "im": 10,
        "sms": 10,
        "mail": 50
    },
    "housekeeper": {
        "event_retention_days": 7,
        "event_delete_batch": 100
    }
}

 

 

sender配置文件,和0.1 相同

sender配置文件

[root@openfalcon_alarm_sender monitor]# cat sender/cfg.json

{
    "debug": true,
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:6066"
    },
    "redis": {
        "addr": "172.16.230.187:6379",
        "maxIdle": 5
    },
    "queue": {
        "im": "/im",
        "mail": "/mail"
    },
    "worker": {
        "im": 10,
        "mail": 50
    },
    "api": {
        "im": "http://172.16.230.191:4567/send",
        "mail": "http://172.16.230.191:4000/sender/mail"
    }
}

 

mail_provider 发送邮件功能,和0.1 相同

[root@openfalcon_alarm_sender monitor]# cat mail_provider/cfg.json
{
    "debug": true,
    "http": {
        "listen": "0.0.0.0:4000",
        "token": ""
    },
    "smtp": {
        "addr": "smtp.163.com:25",
        "username": "fengjian1585@163.com",
        "password": "111111111111111111111111111",
        "from": "fengjian1585@163.com"
    }
}

 

nodata 用于检查未上报的报警,比如agent挂了,nodata 会生成一条模拟数据,用户配置相关报警策略

[root@openfalcon_alarm_sender monitor]# cat nodata/config/cfg.json 
{
    "debug": true,
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:6090"
    },
    "plus_api":{
        "connectTimeout": 500,
        "requestTimeout": 2000,
        "addr": "http://172.16.230.189:8080",
        "token": "default-token-used-in-server-side"
    },
    "config": {
        "enabled": true,
        "dsn": "openfalcon:123456@tcp(172.16.230.188:3306)/falcon_portal?loc=Local&parseTime=true&wait_timeout=604800",
        "maxIdle": 4
    },
    "collector":{
        "enabled": true,
        "batch": 200,
        "concurrent": 10
    },
    "sender":{
        "enabled": true,
        "connectTimeout": 500,
        "requestTimeout": 2000,
        "transferAddr": "172.16.230.181:6060",
        "transferAddr": "172.16.230.182:6060",
        "batch": 500
    }
}

 

task配置文件更新图表的索引,请出垃圾索引

[root@openfalcon_alarm_sender monitor]# cat task/cfg.json 

{
    "debug": false,
    "http": {
        "enable": true,
        "listen": "0.0.0.0:8002"
    },
    "index": {
        "enable": true,
        "dsn": "openfalcon:senyint.rh@tcp(172.16.230.188:3306)/graph?loc=Local&parseTime=true",
        "maxIdle": 4,
        "autoDelete": false,
        "cluster":{
            "openfalcon_judge1:6071" : "0 0 0 ? * 0-5",
            "openfalcon_judge2:6071" : "0 30 0 ? * 0-5"
        }
    },
    "collector" : {
        "enable": false,
        "destUrl" : "http://127.0.0.1:1988/v1/push",
        "srcUrlFmt" : "http://%s/statistics/all",
        "cluster" : [
            "transfer1,openfalcon_transfer1:6060",
            "transfer2,openfalcon_transfer2:6060",
            "graph1,openfalcon_graph1:6071",
            "graph2,openfalcon_graph2:6071",
            "task,openfalcon_alarm_sender:8002"
        ]
    }
}

 

aggregator 聚合报警

[root@openfalcon_alarm_sender aggregator]# cat config/cfg.json 
{
    "debug": true,
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:6055"
    },
    "database": {
        "addr": "openfalcon:123456@tcp(172.16.230.188:3306)/falcon_portal?loc=Local&parseTime=true",
        "idle": 10,
        "ids": [1, -1],
        "interval": 55
    },
    "api": {
        "connect_timeout": 500,
        "request_timeout": 2000,
        "plus_api": "http://172.16.230.189:8080",
        "plus_api_token": "default-token-used-in-server-side",
        "push_api": "http://127.0.0.1:1988/v1/push"
    }
}

 

agent配置文件

[root@openfalcon_alarm_sender monitor]# cat agent/config/cfg.json 
{
    "debug": true,
    "hostname": "production_bj_172.16.230.191_monitor_aggregator",
    "ip": "",
    "plugin": {
        "enabled": false,
        "dir": "./plugin",
        "git": "https://github.com/open-falcon/plugin.git",
        "logs": "./logs"
    },
    "heartbeat": {
        "enabled": true,
        "addr": "172.16.230.180:6030",
        "interval": 60,
        "timeout": 1000
    },
    "transfer": {
        "enabled": true,
        "addrs": [
            "172.16.230.181:8433",
            "172.16.230.182:8433"
        ],
        "interval": 60,
        "timeout": 1000
    },
    "http": {
        "enabled": true,
        "listen": ":1988",
        "backdoor": false
    },
    "collector": {
        "ifacePrefix": ["eth", "em","ens"],
        "mountPoint": []
    },
    "default_tags": {
    },
    "ignore": {
        "cpu.busy": true,
        "cpu.guest": true,
        "cpu.irq": true,
        "cpu.nice": true,
        "cpu.softirq": true,
        "cpu.steal": true,
        "cpu.switches": true,
        "cpu.system": true,
        "cpu.user": true,
        "net.if.in.compressed": true,
        "net.if.in.fifo.errs": true,
        "net.if.in.frame.errs": true,
        "net.if.in.multicast": true,
        "net.if.out.carrier.errs": true,
        "net.if.out.collisions": true,
        "net.if.out.compressed": true,
        "net.if.out.fifo.errs": true,
        "net.if.total.dropped": true,
        "net.if.total.errors": true,
        "df.bytes.free": true,
        "df.bytes.total": true,
        "df.bytes.used": true,
        "df.inodes.total": true,
        "df.inodes.free": true,
        "df.inodes.used": true,
        "df.inodes.used.percent": true,
        "mem.memtotal": true,
        "mem.memused": true,
        "mem.memfree": true,
        "mem.swaptotal": true,
        "mem.swapused": true,
        "mem.swapfree": true
    }
}

 

 

 

 

 

 

 

 

posted @ 2017-06-21 10:41  fengjian1585  阅读(728)  评论(0编辑  收藏  举报