Code Monkey home page Code Monkey logo

stats-ag's Introduction

Description

A small process that collects and outputs system metrics to designated log files. Also runs executable scripts, returning simple data, which are placed in the appropriate location.

Building

To build the binary, use the following example:

go build -ldflags "-X main.build_date=`date +%Y-%m-%d` -X main.VERSION=X.Y.Z -X main.COMMIT_SHA=`git rev-parse --verify HEAD`" -o stats-ag

Or use this method to build for another OS/Architecture

GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.BUILD_DATE=`date +%Y-%m-%d` -X main.VERSION=X.Y.Z -X main.COMMIT_SHA=`git rev-parse --verify HEAD`" -o stats-ag

Command options

  • -v: Show application version and exit
  • -d: Enable verbose debug mode (default: false)
  • -m: Location where metrics log files are written (default: /var/log/stats-ag)
  • -p: Date prefix format for metric entries, either RFC822Z, ISO8601, RFC3339 or SYSLOG (default: SYSLOG)
  • -s: Location where custom metrics scripts are located (default: /opt/stats-ag/scripts)

Usage examples

Calling the script manually:

stats-ag -m /var/log/stats-ag/metrics/ -s /opt/stats-ag/scripts/ -p ISO8601

Or having a cron run it every minute:

* * * * * /opt/stats-ag/stats-ag -m /var/log/stats-ag/metrics/ -s /opt/stats-ag/scripts/ -p ISO8601

Authors

Alain Lefebvre (alain.lefebvre 'at' lightspeedhq.com)

License

Convered under the MIT License

stats-ag's People

Contributors

alefebvre-ls avatar hartfordfive avatar

Stargazers

Felipe Monteiro avatar Danilo Chilene avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Frank Messier avatar

stats-ag's Issues

Add JSON output option

Should have the ability to specify the output format "-f" as either regular KV or JSON

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.