Bernd Ahlers – Graylog, Inc. [email protected] ● Bernd Ahlers ● Working as engineer at Graylog, Inc. in Hamburg/Germany ● [email protected] ● twitter.com/berndahlers ● github.com/bernd About me
Bernd Ahlers – Graylog, Inc. [email protected] Configuration management tools like Puppet or Chef enable us to manage our computing resources in an effective and consistent way Introduction
Bernd Ahlers – Graylog, Inc. [email protected] They make it easy to run hundreds or thousands of machines without having to manually execute the same tasks over and over again Introduction
Bernd Ahlers – Graylog, Inc. [email protected] By using shared modules/cookbooks it is pretty easy to end up with hundreds of managed resources like files, packages and services per node Introduction
Bernd Ahlers – Graylog, Inc. [email protected] Nodes can be configured to run at a regular interval to check for updates and to apply new changes automatically Introduction
Bernd Ahlers – Graylog, Inc. [email protected] This allows us to roll out changes to lots of nodes very easily but also makes it possible to quickly break our infrastructure resulting in outages that might affect our business Introduction
Bernd Ahlers – Graylog, Inc. [email protected] Being able to collect, analyze, and monitor all events that happen during a Chef or Puppet run sounds like a good thing to me Introduction
Bernd Ahlers – Graylog, Inc. [email protected] It would make it possible to quickly analyze if an incident has been caused by changes to the configuration management system Introduction
Bernd Ahlers – Graylog, Inc. [email protected] Having the exceptions thrown during a configuration management run available in a central place can help debugging problems Introduction
Bernd Ahlers – Graylog, Inc. [email protected] Popular open source configuration management tool that uses Ruby to provide a powerful DSL for defining and managing resources Tools: Chef
Bernd Ahlers – Graylog, Inc. [email protected] ● Started by Lennart Koopmann in his free time in 2010 (Graylog2 at that time) ● TORCH GmbH founded as company behind Graylog in late 2012 ● Big rewrite that got released as 0.20 in Feb 2014 Tools: Graylog
Bernd Ahlers – Graylog, Inc. [email protected] ● New US based company Graylog, Inc. founded in Jan 2015 ● Renamed from Graylog2 to Graylog ● Graylog 1.0 release in Feb 2015 Tools: Graylog
Bernd Ahlers – Graylog, Inc. [email protected] Getting events from Chef into Graylog Building a consumer for the internal event bus More than 60 event callbacks available
Bernd Ahlers – Graylog, Inc. [email protected] Getting events from Chef into Graylog Consuming Chef events requires a Start Handler that listens for events
Bernd Ahlers – Graylog, Inc. [email protected] Getting events from Chef into Graylog GELF JSON based format to send structured events to a Graylog server
Bernd Ahlers – Graylog, Inc. [email protected] Getting events from Chef into Graylog Callbacks have access to lots of details about the Chef run Will be added to the events
Bernd Ahlers – Graylog, Inc. [email protected] Getting events from Chef into Graylog Using HTTP makes it easy to implement the same for other configuration management systems
Bernd Ahlers – Graylog, Inc. [email protected] Getting events from Chef into Graylog Install gem and configure Start Handler in chef-client configuration file /etc/chef/client.rb
Bernd Ahlers – Graylog, Inc. [email protected] Getting events from Chef into Graylog begin require 'chef/handler/graylog/gelf_start_handler' # IP address and port of the GELF HTTP input on # your Graylog server. graylog_server_url = 'http://10.0.2.2:12201/gelf' options = {} start_handlers << Chef::Handler::Graylog::GelfStartHandler.new( graylog_server_url, options) rescue Object => e Chef::Log.error( "Loading Graylog start handler failed: #{e.message}") end
Bernd Ahlers – Graylog, Inc. [email protected] Finish Source code for the event handler and the demo setup available on GitHub https://github.com/Graylog2/chef-handler-graylog https://github.com/Graylog2/osdc-2015-demo Contributions welcome!