Giter VIP home page Giter VIP logo

gmetric's Introduction

GMetric

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.

http://www.igvita.com/2010/01/28/cluster-monitoring-with-ganglia-ruby/

Example: Sending a gmetric to a gmond over UDP

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

## Example: Generating the Meta and Metric packets

```ruby
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 = UDPSocket.new
s.connect("127.0.0.1", 8670)
s.send g[0], 0
s.send g[1], 0

Spoofing a hostname in gmetrics

To spoof a hostname with the gmetric library you will need to add the following keys to your gmetric. This works with both GMetric.send() and GMetric.pack().

  • spoof - takes a value of 1 or True
  • hostname - expects a value of ip_address:hostname.

License

The MIT License, Copyright (c) 2009 Ilya Grigorik

gmetric's People

Contributors

dj2 avatar igrigorik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.