Code Monkey home page Code Monkey logo

ostat's Introduction

ostat

Overview

Ostat is an extremely lightweight Linux daemon that provides basic systems metrics in json via a TCP server. Values are background refreshed on a -update-int seconds intervals and stored in memory for access.

Ostat includes the ofetch tool (utils/ofetch) for quickly gathering metrics from a whole network of hosts in a highly parallelized fashion.

Usage

$ ostat -h
Usage of ./ostat:
  -listen string
        Listen address:port (default "localhost:8080")
  -update-int int
        Metrics update interval (default 30)

Output with comments:

$ echo "stats" | nc localhost 8080 | jq '.'                                                                           
{
  "hostname01": {
    "general": {
      "uptime": 405602, # seconds
      "cpu": {
        "Model": "Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz",
        "cores": 2
      },
      "load": {
        "short": 1.05,
        "mid": 0.01,
        "long": 0.05,
        "procs": 117
      },
      "mem": {
        "total": 8175632, # All mem values in KB
        "free": 6845488,
        "used": 1330144,
        "usedp": 16, # Memory used in percent, excludes buffers/cache
        "shared": 0, 
        "buffer": 102332,
        "swaptotal": 0,
        "swapfree": 0
      }
    },
    "storage": {
      "/": { # All mounted block-device filesystems are automatically discovered
        "free": 60062488, # All storage values in KB
        "inodesfree": 3838717,
        "inodestotal": 3932160,
        "inodesused": 93443,
        "total": 61784292,
        "type": "ext4",
        "used": 1721804,
        "usedp": 2 # Storage used in percent
      }
    }
  }
}

Setup

  • go get github.com/jamiealquiza/ostat
  • go install github.com/jamiealquiza/ostat
  • Binary will be found at $GOPATH/bin/ostat

ostat's People

Contributors

jamiealquiza avatar

Stargazers

Kaveh Shahbazian avatar

Watchers

James Cloos avatar  avatar

Forkers

galactus009

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.