Git Product home page Git Product logo

gostatgrab's Introduction

gostatgrab

Gostatgrab is a Go wrapper for the statgrab library from the i-scream group. It closely reproduces the API provided by libstatgrab, providing CPU usage, VM usage, disk statistics, process information, network information and other resource information across a wide range of UNIX platforms. (But, like many current projects, we really only expect it will run on Linux.)

License

Statgrab itself is LGPL; Gostatgrab is BSD licensed, which is as close as we come to "we don't care, it's just wrapper code, man."

Building Gostatgrab

Gostatgrab requires libstatgrab, and uses pkg-config to determine how to compile against libstatgrab. Most Linux distributions have statgrab packages in their community repositories.

Gostatgrab uses "go build" as a build system; with a weekly Go installation, as of 2/2012, this is as easy as "go get github.com/swdunlop/gostatgrab"

Using Gostatgrab

An example, jsongrab, demonstrates how to use the API. On most modern platforms, elevated privileges are not required; on other platforms, Gostatgrab will drop privileges as soon as possible -- once libstatgrab has kicked off its pipe.

Once jsongrab has been read and digested, the rest follows naturally after reading the statgrab(3) manpages.

Improving Gostatgrab

Please submit any improvements as github pull requests, or if religiously opposed, diffs. Pull requests tend to be faster, as they are quicker off the block for review time.

With bug reports, be sure to include OS distribution, Go version and Statgrab version.

Why We Did It?

We use Go for weird little widgets in appliances, and wanted a system health monitor that integrated into our system. Since statgrab thoroughly wrings the weirdness out of many of these API's, we decided to wrap that instead of rolling yet another POSIX abstraction layer.

I suppose we could have used Python..

-- Scott.

gostatgrab's People

Contributors

swdunlop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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