• open-falcon监控业务URL探测


    源码安装

    安装依赖
    yum install -y redis
    yum install -y mysql-server
    
    导入数据库
    wget https://raw.githubusercontent.com/URLooker/web/master/schema.sql
    mysql -h 127.0.0.1 -u root -p < schema.sql

    安装web

     
    yum install -y go

    mkdir -pv /root/go/src/github.com/urlooker
    git clone https://github.com/URLooker/web.git
    cd  /root/go/src/github.com/urlooker/web

    ./control build
    ./control start
     
    编辑cfg.example.json 配置文件
    {
        "debug": false,
        "admins":["ning","admin"],
        "salt": "have fun!",
        "past": 30,
        "http": {
            "listen": "0.0.0.0:1984",
            "secret": "secret"
        },
        "rpc": {
            "listen": "0.0.0.0:1985"
        },
        "mysql": {
            "addr": "root:xiaoyaolaotou@tcp(127.0.0.1:3306)/urlooker?charset=utf8&&loc=Asia%2FShanghai",
            "idle": 10,
            "max": 20
        },
        "ldap": {
            "enabled": false,
            "addr": "ldap.example.com:389",
            "baseDN": "dc=example,dc=com",
            "bindDN": "cn=mananger,dc=example,dc=com",
            "bindPasswd": "12345678",
            "userField": "uid",
            "attributes": ["sn","mail","telephoneNumber"]
        },
        "alarm":{
            "enable": true,
            "batch": 200,
            "replicas": 500,
            "connTimeout": 1000,
            "callTimeout": 5000,
            "maxConns": 32,
            "maxIdle": 32,
            "sleepTime":30,
            "cluster":{
                "node-1":"127.0.0.1:1986"
            }
        },
        "monitorMap": {
            "default":["hostname.1"],
            "idc1":["hostname.2"]
        },
        "falcon":{
            "enable": false,
            "addr":"http://falcon.transfer.addr/api/push",
            "interval": 60
        },
        "internalDns":{
            "enable": false,
            "addr":""
        }
    }
    启动web
    nohup ./urlooker-web -c cfg.example.json >/dev/null &

    用浏览器打开

    
    
    

    安装agent

    mkdir -pv /usr/lib/golang/src/github.com/urlooker
    
    git clone https://github.com/URLooker/agent.git
    
    cd agent
    
    ./control build
    ./control start
    编辑配置文件
    [root@localhost agent]# cat cfg.example.json 
    {
        "debug": false,
        "hostname": "hostname.1", #要和server端的配置文件里的一致
        "worker": 1000,
        "web": {
            "addrs": ["192.168.1.100:1985"], #server端的1985地址
            "interval": 60,
            "timeout": 1000
        }
    }

    启动url客户端

    nohup ./urlooker-agent -c cfg.example.json >/dev/null &

    安装alarm报警组件

    mkdir -pv /root/go/src/github.com/urlooker
    cd /root/go/src/github.com/urlooker
    git clone https://github.com/URLooker/alarm.git
    cd alarm
    ./control build
    ./control start

    配置报警邮件配置

    [root@localhost alarm]# cat cfg.example.json 
    {
        "debug": false,
            "remain":10,
            "rpc":{
                    "listen":"0.0.0.0:1986"
            },
        "web": {
            "addrs": ["127.0.0.1:1985"],
            "timeout": 300,
            "interval": 60
        },
        "alarm": {
            "enabled": true,
            "minInterval": 180,
            "queuePattern": "event",
            "redis": {
                "dsn": "127.0.0.1:6379",
                "maxIdle": 5,
                "connTimeout": 20000,
                "readTimeout": 20000,
                "writeTimeout": 20000
            }
        },
        "queue": {
            "sms": "/sms",
            "mail": "/mail"
        },
        "worker": {
            "sms": 10,
            "mail": 50
        },
        "sms": "",
        "smtp": {
            "addr": "smtp.163.com:994",
            "username": "xxx",
            "password": "xxxx",
            "from": "xxxxx"
        }
    }

    启动报警组件

    nohup ./urlooker-alarm -c cfg.example.json >/dev/null &

    测试URL探测是否报警

    登录web界面配置用户以及团队创建

    配置URL探测

    
    



    收到邮件报警







    安装web
  • 相关阅读:
    通过反射实现IOC功能
    数据访问模式之Repository模式
    .NET自带IOC容器MEF之初体验
    权限管理系统进入关键的开发阶段
    待销售分拣单App数据推送
    做一个自己的权限管理系统
    linux tar 命令 --致力于“一眼看懂,随手就用”的随笔
    python 简单实现文件拷贝
    实验比较python中的range和xrange
    安装 chardet ,出现ImportError: No module named setuptools
  • 原文地址:https://www.cnblogs.com/zhangzihong/p/10396977.html
Copyright © 2020-2023  润新知