Collect and forward metrics using portable shell scripts
Go to file
Patrick Stadler e99763c381 clean up 2015-03-21 22:14:56 +01:00
init.d docs / init script 2015-03-17 21:01:01 +01:00
lib clean up 2015-03-21 22:14:56 +01:00
metrics add defaults() fn. add --print-config. config loader now fails on error 2015-03-21 21:19:08 +01:00
reporters add defaults() fn. add --print-config. config loader now fails on error 2015-03-21 21:19:08 +01:00
README.md enable -m <alias> / -r <alias> 2015-03-21 22:03:29 +01:00
metrics.sh add defaults() fn. add --print-config. config loader now fails on error 2015-03-21 21:19:08 +01:00

README.md

metrics.sh

metrics.sh is a lightweight metrics collection and fowarding utility implemented in portable POSIX compliant shell scripts. A transparent interface based on hooks enables writing custom metric collectors and reporters in an elegant way.

Usage

$ ./metrics.sh --help

  Usage: ./metrics.sh [-d] [-h] [-v] [-c] [-m] [-r] [-i]

  Options:

    -c, --config   <file>      path to config file
    -m, --metrics  <metrics>   comma-separated list of metrics to collect
    -r, --reporter <reporter>  use specified reporter (default: stdout)
    -i, --interval <seconds>   collect metrics every n seconds (default: 2)
    -v, --verbose              enable verbose mode
    -d, --docs                 show documentation
    -h, --help                 show this text

Installation

$ git clone git@github.com:pstadler/metrics.sh.git

TODO: /etc/init.d

Requirements

metrics.sh has been tested on Ubuntu and Mac OS X but is supposed to run on most *NIX-like operating systems. Some of the provided metrics require procfs to be available.

Metrics

Metric Description
cpu CPU usage in %
memory Memory usage in %
swap Swap usage in %
network_io Network I/O in kB/s
disk_io Disk I/O in MB/s
disk_usage Disk usage in %
heartbeat System heartbeat
ping Check whether a remote host is reachable

TODO: how to write custom metrics

Reporters

TODO: how to write custom reporters

TODO

  • README
  • config file docs
  • load custom/contrib metrics and reporters
  • allow multiple reporters?