Giter Club home page Giter Club logo

ops-agent's Introduction

ops-agent

基于open-falcon二次开发的linux监控客户端

特性

  • 代码重构、移除无用的接口和配置信息;
  • 重写url metric的probeUrl方法, 使用go http库替代使用系统curl命令来探测url;
  • 重写/plugin/update接口, 使用go-git库替代使用系统的git命令来更新插件仓库;
  • 新增从私有git仓库同步插件功能;
  • 新增运行日志配置, 支持日志滚动;
  • 新增/metrics接口, 支持查看当前监控的所有metric;
  • 新增/metric/check接口, 支持查看当前系统metric依赖环境;
  • 新增cpu核心绑定、内存阈值配置; 当agent内存达到阈值的50%时, 打印告警信息;当内存达到阈值的100%, 程序直接退出;

编译

it is a golang classic project

cd $GOPATH/src/github.com/fanghongbo/ops-agent/
./control build
./control start

配置

Refer to cfg.example.json, modify the file name to cfg.json :

{
  "debug": false,
  "hostname": "",
  "ip": "",
  "log": {
    "log_level": "INFO",
    "log_path": "./logs",
    "log_file_name": "run.log",
    "log_keep_hours": 3
  },
  "plugin": {
    "enabled": true,
    "dir": "./plugin",
    "git": "https://github.com/open-falcon/plugin.git",
    "username": "",
    "password": "",
    "logs": "./logs"
  },
  "heartbeat": {
    "enabled": true,
    "addr": "127.0.0.1:6030",
    "interval": 60,
    "timeout": 1000
  },
  "transfer": {
    "enabled": true,
    "addrs": [
      "127.0.0.1:8433"
    ],
    "interval": 60,
    "timeout": 1000
  },
  "http": {
    "enabled": true,
    "listen": ":1988"
  },
  "collector": {
    "ifacePrefix": [
      "eth",
      "em",
      "ens"
    ],
    "mountPoint": []
  },
  "default_tags": {
  },
  "ignore": {
    "cpu.busy": true,
    "df.bytes.free": true,
    "df.bytes.total": true,
    "df.bytes.used": true,
    "df.bytes.used.percent": 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.memused.percent": true,
    "mem.memfree": true,
    "mem.swaptotal": true,
    "mem.swapused": true,
    "mem.swapfree": true
  },
  "max_cpu_rate": 0.2,
  "max_mem_rate": 0.3
}

License

This software is licensed under the Apache License. See the LICENSE file in the top distribution directory for the full license text.

ops-agent's People

Contributors

fanghongbo avatar

Stargazers

flystar0 avatar KAYUII avatar  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.