Skip to content

Instantly share code, notes, and snippets.

@ianrumford
Created January 13, 2013 16:13
Show Gist options
  • Select an option

  • Save ianrumford/4524871 to your computer and use it in GitHub Desktop.

Select an option

Save ianrumford/4524871 to your computer and use it in GitHub Desktop.
Riemann Feeds blog_feed_jmx1_each_event.rb
def each_event
beanInst = find_jmx_bean_or_croak('Hadoop:service=NameNode,name=NameNodeActivity')
yield({host: '10.16.0.48', service: 'NameNode', status: 'ok', tags: ["YARN", "NameNode", "Activity", "Files"], metric: beanInst.files_created, description: 'files_created'})
yield({host: '10.16.0.48', service: 'NameNode', status: 'ok', tags: ["YARN", "NameNode", "Activity", "Files"], metric: beanInst.files_deleted, description: 'files_deleted'})
beanInst = find_jmx_bean_or_croak('java.lang:type=OperatingSystem')
(r = map_free_physical_memory_size_568369({host: '10.16.0.48', service: 'NameNode', status: 'ok', tags: ["YARN", "NameNode", "OS", "FreeMem"], metric: metric_free_physical_memory_size_710285(beanInst.free_physical_memory_size), description: 'free_physical_memory_size'})) && select_free_physical_memory_size_237256(r) && yield(r)
yield({host: '10.16.0.48', service: 'NameNode', status: 'ok', tags: ["YARN", "NameNode", "OS"], metric: beanInst.free_swap_space_size, description: 'free_swap_space_size'})
yield({host: '10.16.0.48', service: 'NameNode', status: 'ok', tags: ["YARN", "NameNode", "OS"], metric: beanInst.total_swap_space_size, description: 'total_swap_space_size'})
yield({host: '10.16.0.48', service: 'NameNode', status: 'ok', tags: ["YARN", "NameNode", "OS"], metric: beanInst.system_load_average, description: 'system_load_average'})
yield({host: '10.16.0.48', service: 'NameNode', status: 'ok', tags: ["YARN", "NameNode", "OS"], metric: beanInst.available_processors, description: 'available_processors'})
self
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment