{"id":20836291,"url":"https://github.com/igrigorik/gmetric","last_synced_at":"2025-05-08T21:25:31.674Z","repository":{"id":793679,"uuid":"492204","full_name":"igrigorik/gmetric","owner":"igrigorik","description":"Pure Ruby interface for generating Ganglia gmetric packets","archived":false,"fork":false,"pushed_at":"2013-08-14T16:54:42.000Z","size":63,"stargazers_count":69,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-02T03:54:14.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.igvita.com/2010/01/28/cluster-monitoring-with-ganglia-ruby/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igrigorik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-01-28T14:22:23.000Z","updated_at":"2024-02-27T07:59:55.000Z","dependencies_parsed_at":"2022-08-16T10:55:12.974Z","dependency_job_id":null,"html_url":"https://github.com/igrigorik/gmetric","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Fgmetric","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Fgmetric/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Fgmetric/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrigorik%2Fgmetric/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igrigorik","download_url":"https://codeload.github.com/igrigorik/gmetric/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238044095,"owners_count":19407128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T00:29:23.390Z","updated_at":"2025-02-10T02:09:42.080Z","avatar_url":"https://github.com/igrigorik.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GMetric\n\nA 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.\n\n[http://www.igvita.com/2010/01/28/cluster-monitoring-with-ganglia-ruby/](http://www.igvita.com/2010/01/28/cluster-monitoring-with-ganglia-ruby/)\n\n## Example: Sending a gmetric to a gmond over UDP\n\n```ruby\nGanglia::GMetric.send(\"127.0.0.1\", 8670, {\n  :name =\u003e 'pageviews',\n  :units =\u003e 'req/min',\n  :type =\u003e 'uint8',\n  :value =\u003e 7000,\n  :tmax =\u003e 60,\n  :dmax =\u003e 300,\n  :group =\u003e 'test'\n})\n```\n## Example: Generating the Meta and Metric packets\n\n```ruby\ng = Ganglia::GMetric.pack(\n  :slope =\u003e 'positive',\n  :name =\u003e 'ruby',\n  :value =\u003e rand(100),\n  :tmax =\u003e 60,\n  :units =\u003e '',\n  :dmax =\u003e 60,\n  :type =\u003e 'uint8'\n)\n\n# g[0] = meta packet\n# g[1] = gmetric packet\n\ns = UDPSocket.new\ns.connect(\"127.0.0.1\", 8670)\ns.send g[0], 0\ns.send g[1], 0\n```\n\n## Spoofing a hostname in gmetrics ##\n\nTo spoof a hostname with the gmetric library you will need to add the following keys to your gmetric.\nThis works with both GMetric.send() and GMetric.pack().\n \n* spoof - takes a value of 1 or True\n* hostname - expects a value of ip_address:hostname.\n\n\n### License\n\nThe MIT License, Copyright (c) 2009 Ilya Grigorik\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrigorik%2Fgmetric","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figrigorik%2Fgmetric","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrigorik%2Fgmetric/lists"}