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.

News Films

Our little film studio focuses on telling developer-centric stories that need to be seen.

Beyond Code: Season 3 / GopherCon 2015

 
0:00 / 0:00