Giter Site home page Giter Site logo

ss-monitor's Introduction

用于监控ss服务器状况的小工具。

搭建指南

  1. 安装golang https://golang.org/doc/install 并设置GOPATH
  2. 执行 go get -u -v github.com/ayanamist/ss-monitor
  3. 单独创建一个目录,如BASEDIR=$HOME/ss-monitor; mkdir $BASEDIR
  4. 改变当面目录 cd $BASEDIR
  5. 复制并编辑配置文件 cp $GOPATH/src/github.com/ayanamist/ss-monitor/config-example.yaml $BASEDIR/config.yaml
  6. 创建html模板 ln -s $GOPATH/src/github.com/ayanamist/ss-monitor/index.htm.tpl $BASEDIR/
  7. 试启动 $GOPATH/bin/ss-monitor 看看有没有报错
  8. 没有报错的话,配置upstart启动脚本vim /etc/init/ss-monitor.conf请提前将环境变量替换好
start on runlevel [2345]
stop on runlevel [!2345]

respawn
chdir $BASEDIR/ss-monitor
exec $GOPATH/bin/ss-monitor
  1. 启动upstart job start ss-monitor
  2. 提供服务。这里有两种方式提供
    1. 使用ss-monitor自己的http服务,优点是简单安全,不会泄漏config.yaml,nginx配置一个反向代理就可以了
    2. 使用渲染好的index.htm,优点是可以和一些静态文件服务集成,例如Github Pages

说明

  • 程序会按照下列顺序选择主目录,将会从选定的主目录中加载配置,并保存数据:
    1. 程序文件所在目录
    2. 执行命令的当前目录(推荐)
  • 用csv格式按天保存数据,启动时自动加载最近若干分钟的数据,加载时间通过oldest_history进行配置。
  • ss url格式支持经过base64转换过的,如蓝云页面二维码中的格式,启动后日志中会有转换提示
  • 可以指定监听端口为127.0.0.1:0来监听随机端口,日志中会输出实际监听的端口号

ss-monitor's People

Contributors

ayanamist avatar

Watchers

vvoody 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.