Wynn Netherland changelog.com/posts

hoardd - Node.js daemon for collecting server metrics to send to Graphite

José de Paula E. Júnior has released Hoardd, a Node.js-based daemon for collecting server data to send to Graphite. With a pluggable scripts architecture similar to Hubot, scripts are written in CoffeeScript or JavaScript to collect and publish data on an interval, such as this load average example:

Fs = require 'fs'
Path = require 'path'

module.exports = (server) ->
  run = () ->
    metricPrefix = "#{server.fqdn}.load_average"
    server.cli.debug "Running load average script"

    # Read from /proc
    procfile = '/proc/loadavg'
    if Path.existsSync procfile
      data = Fs.readFileSync(procfile, 'utf-8')
      [one, five, fifteen] = data.split(' ', 3)
      server.push_metric "#{metricPrefix}.short", one
      server.push_metric "#{metricPrefix}.medium", five
      server.push_metric "#{metricPrefix}.long", fifteen

Be sure and check out Graphiti to view your Graphite data. Also head over to the hoardd repo to install or contribute a script.


Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00