Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Pure Ruby interface for generating Ganglia gmetric packets

tree: 11a5d597bc

Fetching latest commit…

Cannot retrieve the latest commit at this time


A pure Ruby client for generating Ganglia 3.1.x+ gmetric meta and metric packets and talking to your gmond / gmetad nodes over UDP protocol. Supports host spoofing, and all the same parameters as the gmetric command line executable.

Example: Sending a gmetric to a gmond over UDP

Ganglia::GMetric.send("", 8670, {
  :name => 'pageviews',
  :units => 'req/min',
  :type => 'uint8',
  :value => 7000,
  :tmax => 60,
  :dmax => 300,
:group => 'test'

Example: Generating the Meta and Metric packets

g = Ganglia::GMetric.pack(
  :slope => 'positive',
  :name => 'ruby',
  :value => rand(100),
  :tmax => 60,
  :units => '',
  :dmax => 60,
  :type => 'uint8'

# g[0] = meta packet
# g[1] = gmetric packet

s =
s.connect("", 8670)
s.send g[0], 0
s.send g[1], 0


The MIT License, Copyright (c) 2009 Ilya Grigorik

Something went wrong with that request. Please try again.