Code Monkey home page Code Monkey logo

ostent's Introduction

Sourcegraph GoDoc Travis CI

ostent collects and displays system metrics and optionally relays to Graphite and/or InfluxDB.

The displaying part (demo) is interactive and customizable.

Screenshot

The metrics:

  • Collected and exported:
    • RAM, swap usage
    • Interfaces bytes, packets, errors ins and outs
    • CPU usage
    • Disk usage
    • Load average
  • On display only:
    • System's OS, IP and uptime
    • Processes top
    • vagrant global-status

The exporting to Graphite and InfluxDB is kept on par with collectd reporting to Graphite with StoreRates true, although the metrics naming is slightly different.

Running

ostent a single executable without dependecies, no extra files required (everything is builtin). Drop it in and just run; being root is unnecesary. There're flags if you have to.

Run the code if you want to, otherwise grab a binary.

Install Release binaries

These binaries self-upgrade whenever there's new stable release and distributed by GitHub Releases.

Install & run with curl -sSL https://github.com/ostrost/ostent/raw/master/ostent.sh | sh

Platforms

FreeBSD (10 amd64 and i386 probably) is to be published with a new release. The master code is runnable already.

Usage

Usage of ostent:
  -bind=:8050: Bind address
  -update=1s: Collection interval

  -sendto-graphite=: Graphite server address
  -graphite-refresh=10s: Graphite refresh interval

  -sendto-influxdb=: InfluxDB server URL
  -influxdb-database="ostent": InfluxDB database
  -influxdb-password="": InfluxDB password
  -influxdb-refresh=10s: InfluxDB refresh interval
  -influxdb-username="": InfluxDB username

Unless -bind (-b for short) is set, ostent binds to *:8050. The bind and Graphite addresses are specified like IP[:port] (default ports being 8050 and 2003 respectively). InfluxDB server must be specified as an URL http://ADDRESS. An interval is a number and a unit: s for seconds, m for minutes etc.

Here's how it goes:

$ ostent                                     ________________
[ostent]    -------------                   < Spot the links >
[ostent]  / server ostent \                  ----------------
[ostent] +------------------------------+           \   ^__^
[ostent] | http://127.0.0.1:8050        |            \  (oo)\_______
[ostent] |------------------------------|               (__)\       )\/\
[ostent] | http://192.168.1.2:8050      |                   ||----w |
[ostent] +------------------------------+                   ||     ||

Running the code

Have your GOPATH environment set, gvm is a must.

  1. go get github.com/ostrost/ostent
  2. ostent to run.

For rebuilding the code and assets:

  1. Find src/github.com/ostrost/ostent directory in GOPATH.
  2. Run make init once and later for packages update (think go get -u)
  3. make or make al when rerun does rebuilding.

Repeat 3. every time sources (esp. assets) change. rerun does live-reloading run: rerun github.com/ostrost/ostent

For a fork, to preserve import paths and packages namespace, clone your fork as if it was github.com/ostrost/ostent package for Go:

  1. go get github.com/ostrost/ostent
  2. Find src/github.com/ostrost/ostent directory in GOPATH.
  3. Replace it with you fork clone.
  4. Continue with rebuilding steps above.

Make

make rebuilds these commited to the repo files:

  • share/templates/bindata.*.go
  • share/assets/bindata.*.go
  • share/assets/js/src/milk/*.js
  • share/assets/js/src/gen/*.js
  • share/templates/*.html
  • share/assets/css/*.css
  • share/tmp/*.jsx

If you don't change source files, content re-generated should not differ from the commited. Whenever share/{ace.templates,style,coffee} modified, you have to re-make.

Additional tools required for assets rebuilding:

The main package

github.com/ostrost/ostent has two main.go files: rerun will find main.dev.go; the other main.bin.go (used when building with -tags bin) is the init code for the distributed binaries: also includes goagain recovering and self-upgrading via go-update.

The assets

The binaries, to be stand-alone, have the assets and templates embeded. Unless you specifically build with -tags bin (e.g with make), the content is not embeded for the ease of development: with rerun, asset requests are served from the actual files. Bin-built ostent restore-assets can be used to copy (extract) assets on disk.

ostent's People

Contributors

rzabaznov avatar

Stargazers

 avatar

Watchers

 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.