Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/igrigorik/gmetric
Pure Ruby interface for generating Ganglia gmetric packets
https://github.com/igrigorik/gmetric
Last synced: 8 days ago
JSON representation
Pure Ruby interface for generating Ganglia gmetric packets
- Host: GitHub
- URL: https://github.com/igrigorik/gmetric
- Owner: igrigorik
- Created: 2010-01-28T14:22:23.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2013-08-14T16:54:42.000Z (over 11 years ago)
- Last Synced: 2025-01-10T01:14:38.244Z (16 days ago)
- Language: Ruby
- Homepage: http://www.igvita.com/2010/01/28/cluster-monitoring-with-ganglia-ruby/
- Size: 61.5 KB
- Stars: 69
- Watchers: 4
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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/](http://www.igvita.com/2010/01/28/cluster-monitoring-with-ganglia-ruby/)
## Example: Sending a gmetric to a gmond over UDP
```ruby
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 packets = 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