Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Easily send the output of any script or command to Graphite at regular intervals
Shell always includes zeros

I forgot that pipe-to-graphite doesn't take arguments after the command
sow we can't use the --include-zeros. Let's just make it the default
cause it only adds a few metrics and missing values is annoying.


Makes it easy to monitor and report just about anything to Graphite from the commandline.


Created initially to report the useful numbers from service memcached status to Graphite. More examples are added as needed.


Write a script that outputs some name value pairs tha your care about. pipe-to-graphite will take care of formatting them and sending them to graphite at regular intervals. The expected output is something like this:

some.thing.count 53453
SomeOtherThing 3522

NOTE: Your script must finish with an exit code of 0 or the output won't be sent to graphite (though it will be logged along with a failure message).


Lets say you want to monitor the glorkd program. Let's say glorkd comes with a script /usr/glork/status that spits out something like this:

Glorkd - v2.1.352
Running: pid 3242
Blargs: 1230
Blorks: 452

You only care about the Blargs and Blorks (those are counts since program start). All you have to do is write a script that does some grepping and awking to get that into this:

Blargs 1230
Blorks 452

Your script (lets say ~/ would look something like this:

/usr/glork/status | tail -n +3 | sed "s/: / /"

To get that regularly reported to Graphite, run this command

./ ~/ >> /var/log/glork-stats.log

Or to report it to graphite at any time, if you want to use cron or something. The '-' argument indicates input should be read form stdin

~/ | ./ -


Output from each run is prepended with a timestamp and echoed to stdout Redirect that wherever you like.

Something went wrong with that request. Please try again.