Metriks

A simpler graphing framework


Project maintained by kvz and sbnedkov Hosted on GitHub Pages — Theme by mattgraham

Metriks

Build Status NPM version Dependency Status Development Dependency Status

Gittip donate button Flattr donate button PayPayl donate button BitCoin donate button

Features

Metriks is basic. If you want advanced, there are plenty of options out there like graphite, mrtg, or (paid) librato. You may also want to have a look at druid, riemann and grafana. However Metriks will never:

Example

Here we'll add a simple graph with response times to different nameservers that looks like this:

kvz-imac-home-4 local-ping 1

To achieve this, open a text file ./plugins/ping.sh, chmod +x it, and make it say:

echo "# config.interval: 60"
echo "# graph.title: Ping resolving nameservers"
echo "# graph.verticalLabel: Roundtrip in ms"

for server in 8.8.8.8 4.2.2.2 208.67.222.222 172.16.0.23; do
  echo "ip_${server} $(ping -c 4 ${server} |tail -1 |awk '{print $4}' |cut -d '/' -f 2)"
done

Options

If you want to keep your plugin files outside of the Metriks source directory, simply point metriks to your own plugin dir via:

metriks --plugin-dir ~/metriks/plugins

By default, metriks writes rrds files to ~/metriks/rrd and images to ~/metriks/png. But you can change that with

metriks --rrd-dir /var/lib/rrd
metriks --png-dir /var/www/graphs

Metriks contains an simple webserver so you can browse the png dir via:

metriks --web-port 8000

If you don't want to automatically build png files but are only interested in gathering data in rrd, use

metriks --auto-write-png false

Todo

Metriks is still in early stages of development, here's what needs to be done still:

Prerequisites

I'm assuming you already have node 0.8+ and Git available.

OSX

To run rrdtool on OSX you'll need XQuartz. Then via Homebrew:

brew install rrdtool coreutils

coreutils is required for timeout, used in integration tests.

Ubuntu

aptitude install rrdtool

Install

Globally

npm install -g metriks

Development

git clone https://github.com/kvz/metriks.git
cd metriks
npm install

Run

With debug output, and a built-in webserver to browser resulting png graphs on port 8000

./bin/metriks --debug --web-port 8000

Test

make test

License

MIT LICENSE