• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Using Nagios with Chef
 

Using Nagios with Chef

on

  • 4,662 views

Nagios World Conference 2012 presentation introduces Chef and demo'd the Nagios cookbook.

Nagios World Conference 2012 presentation introduces Chef and demo'd the Nagios cookbook.

Statistics

Views

Total Views
4,662
Views on SlideShare
4,639
Embed Views
23

Actions

Likes
8
Downloads
78
Comments
1

5 Embeds 23

https://twitter.com 13
http://www.unscatter.com 6
https://www.linkedin.com 2
http://www.linkedin.com 1
http://www.slashdocs.com 1

Accessibility

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • Systems\n
  • Who considers there job to be operations or running servers?\n
  • 1 week each?\nDifferent departments schedules\n
  • 1 week each?\nDifferent departments schedules\n
  • 1 week each?\nDifferent departments schedules\n
  • 1 week each?\nDifferent departments schedules\n
  • 1 week each?\nDifferent departments schedules\n
  • 1 week each?\nDifferent departments schedules\n
  • 1 week each?\nDifferent departments schedules\n
  • Now application deployment needs to be fast\n
  • Now application deployment needs to be fast\n
  • DR: Bare metal, application data backup, chef repository\n\n
  • DR: Bare metal, application data backup, chef repository\n\n
  • Who works in operations?\n
  • \n
  • \n
  • Who here uses Chef?\nIntrastructure as Code\n\n
  • idempotency: If it is right, do nothing. If it is wrong, fix it.\nreasonable: no surprises to the platform user\nprimitives: the unix way\nscalable: hosted chef\n
  • idempotency: If it is right, do nothing. If it is wrong, fix it.\nreasonable: no surprises to the platform user\nprimitives: the unix way\nscalable: hosted chef\n
  • idempotency: If it is right, do nothing. If it is wrong, fix it.\nreasonable: no surprises to the platform user\nprimitives: the unix way\nscalable: hosted chef\n
  • idempotency: If it is right, do nothing. If it is wrong, fix it.\nreasonable: no surprises to the platform user\nprimitives: the unix way\nscalable: hosted chef\n
  • idempotency: If it is right, do nothing. If it is wrong, fix it.\nreasonable: no surprises to the platform user\nprimitives: the unix way\nscalable: hosted chef\n
  • idempotency: If it is right, do nothing. If it is wrong, fix it.\nreasonable: no surprises to the platform user\nprimitives: the unix way\nscalable: hosted chef\n
  • idempotency: If it is right, do nothing. If it is wrong, fix it.\nreasonable: no surprises to the platform user\nprimitives: the unix way\nscalable: hosted chef\n
  • Nodes are data objects - servers, network switches, Google Compute Engine\n\n
  • Nodes are data objects - servers, network switches, Google Compute Engine\nplatform, platform_version\n
  • Clients are authentication objects\npublic key / private key\n
  • Cookbooks are something you would manage\n
  • Nodes are data objects\nClients are authentication objects\nCookbooks are something you would manage\n
  • Nodes are data objects\nClients are authentication objects\nCookbooks are something you would manage\n
  • Nodes are data objects\nClients are authentication objects\nCookbooks are something you would manage\n
  • Nodes are data objects\nClients are authentication objects\nCookbooks are something you would manage\n
  • Workflow: Environments control cookbook versions\n
  • Nodes are data objects\nClients are authentication objects\nCookbooks are something you would manage\n
  • \n
  • \n
  • Hackable\nshef -> chef-shell\n
  • Service Oriented Architecture\n
  • Primitives\n
  • Primitives\n
  • Idempotent\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Using Nagios with Chef Using Nagios with Chef Presentation Transcript

  • Configuring Nagios with ChefBryan McLellanTechnical Program Manager, Open Sourcebtm@opscode.com / @btmspox
  • Overview• Who am I?• Why automation• Introduction to Chef• Nagios Demo• Questions
  • Who am I?• Chef Early developer, user, pundit• 10+ years in Systems Administration Computer repair, ISPs, Corporate IT, Web operations• Event Logistics Volunteer Traffic Control, Parking, Communications, Networking, Emergency Management• Hacker-Operator
  • How did we get here?Bare Metal Deployment
  • How did we get here?Bare Metal Deployment • Purchasing
  • How did we get here?Bare Metal Deployment • Purchasing • Vendor build
  • How did we get here?Bare Metal Deployment • Purchasing • Vendor build • Delivery
  • How did we get here?Bare Metal Deployment • Purchasing • Vendor build • Delivery • Installation
  • How did we get here?Bare Metal Deployment • Purchasing • Vendor build • Delivery • Installation • OS deployment
  • How did we get here?Bare Metal Deployment • Purchasing • Vendor build • Delivery • Installation • OS deployment • Application deployment
  • How did we get here?Bare Metal Deployment • Purchasing • Vendor build • Delivery Weeks? • Installation • OS deployment • Application deployment
  • How did we get here?Cloud or Virtual Deployment • Purchasing • Vendor build • Delivery Nearly immediate • Installation • OS deployment • Application deployment
  • How did we get here?Cloud or Virtual Deployment • Purchasing • Vendor build • Delivery Nearly immediate • Installation • OS deployment • Application deployment Must be fast
  • Why automate? Good Reasons:• More agility and faster scalability• Improved infrastructure documentation• Better disaster recovery
  • Why automate? Good Reasons:• More agility and faster scalability• Improved infrastructure documentation• Better disaster recovery Really Good Reasons:• Spend less time on monotonous tasks• Spend more time solving interesting problems
  • Why automate?Operations is responsible for two things:
  • Why automate?Operations is responsible for two things:1. Availability
  • Why automate?Operations is responsible for two things:1. Availability2. Efficiency
  • What is Chef?• Configuration management language• Systems integration framework• API for your infrastructure http://www.flickr.com/photos/morville/3220961040/
  • Chef Principles
  • Chef Principles• Idempotent
  • Chef Principles• Idempotent• Reasonable
  • Chef Principles• Idempotent• Reasonable• Primitives
  • Chef Principles• Idempotent• Reasonable• Primitives• Scalable
  • Chef Principles• Idempotent• Reasonable• Primitives• Scalable• Hackable
  • Chef Principles• Idempotent• Reasonable• Primitives• Scalable• Hackable• Shareable
  • Chef BasicsChef manages Nodes
  • Chef BasicsChef manages NodesNodes have Attributes
  • Chef BasicsChef manages NodesNodes have AttributesUsers and Nodes authenticate as Clients
  • Chef BasicsChef manages NodesNodes have AttributesUsers and Nodes authenticate as ClientsCookbooks contain Recipes
  • Chef BasicsChef manages NodesNodes have AttributesUsers and Nodes authenticate as ClientsCookbooks contain RecipesEach node has a Run List
  • Chef BasicsChef manages NodesNodes have AttributesUsers and Nodes authenticate as ClientsCookbooks contain RecipesEach node has a Run ListA Run List is a list of Recipes to run
  • Chef BasicsChef manages NodesNodes have AttributesUsers and Nodes authenticate as ClientsCookbooks contain RecipesEach node has a Run ListA Run List is a list of Recipes to runA Role also has a Run List
  • Chef BasicsChef manages NodesNodes have AttributesUsers and Nodes authenticate as ClientsCookbooks contain RecipesEach node has a Run ListA Run List is a list of Recipes to runA Role also has a Run ListRoles can also be added to a Node’s Run List
  • Chef BasicsChef manages NodesNodes have AttributesUsers and Nodes authenticate as ClientsCookbooks contain RecipesEach node has a Run ListA Run List is a list of Recipes to runA Role also has a Run ListRoles can also be added to a Node’s Run ListNodes can be in Environments
  • Chef BasicsChef manages NodesNodes have AttributesUsers and Nodes authenticate as ClientsCookbooks contain RecipesEach node has a Run ListA Run List is a list of Recipes to runA Role also has a Run ListRoles can also be added to a Node’s Run ListNodes can be in EnvironmentsData bags are... bags of data.
  • Chef Basics Visualized client: srv01 client: srv02 client: srv03 node: srv01 node: srv02 node: srv03 run_list: “role[web_server]” run_list: “role[web_server]” run_list: “role[db_server]” role: web_server role: db_serverrun_list: [“recipe[apache2]”, “recipe[php]” ] run_list: [ “recipe[mysql]”, “recipe[nfs]” ]
  • Application Programming Interface The Meatcloud ManifestoGive me an API or give me death. -- Andrew Clay Shafer (@littleidea)
  • Chef Stackschef-client knife chef-shell chef-solo API Open Source Hosted Chef Private Chef
  • Chef 10 Open Source Architecture Chef Expander
  • Resources• A Resource is something you manage service, package, file, user, execute, git
  • Resources• A Resource is something you manage service, package, file, user, execute, git• Resources have actions start, install, create, deploy• Resources can notify of other resources
  • Resources• A Resource is something you manage service, package, file, user, execute, git• Resources have actions start, install, create, deploy• Resources can notify of other resources cookbook_file “/etc/apache2/apache2.conf” do source “apache2.conf” owner “root” group “root” mode 0644 notifies :restart, “service[apache2]” end
  • Providers• A Provider performs the actions specified by the resource
  • Providers• A Provider performs the actions specified by the resource• Each Resource can have multiple providers package: apt, yum, macports... service: upstart, windows, systemd...
  • Providers• A Provider performs the actions specified by the resource• Each Resource can have multiple providers package: apt, yum, macports... service: upstart, windows, systemd...• Each platform (OS) has default Providers that can be package “sudo” do provider Chef::Provider::Package::Yum action :install end
  • A basic recipepackage “apache2” do action :installend
  • A basic recipepackage “apache2” do action :installendservice “apache2” do action :enableend
  • A basic recipepackage “apache2” do action :installendservice “apache2” do action :enableendcookbook_file “/etc/apache2/apache2.conf” do source “apache2.conf” owner “root” group “root” mode 0644end
  • A basic recipepackage “apache2” do action :installendservice “apache2” do action :enableendcookbook_file “/etc/apache2/apache2.conf” do source “apache2.conf” owner “root” group “root” mode 0644endservice “apache2” do action :startend
  • A basic recipepackage “apache2” do action :installendservice “apache2” do action :enable supports [ :restart, :reload, :status ]endcookbook_file “/etc/apache2/apache2.conf” do source “apache2.conf” owner “root” group “root” mode 0644 notifies :restart, “service[apache2]”endservice “apache2” do action :startend
  • SearchSearch is a first class citizen# Find all nodes in production that are tagged ‘group_d’search(:node, “tags:group_d AND chef_environment:prod”)# Find the mail server in this environmentsearch (:node, “role:mail_server AND chef_environment:corp”)Search and Ruby are powerful allies# Find all my nodes that run on HP hardwarenodes = search(:node, “dmi_systems_manufacturer:HP”)# Dynamically create a config in a template<% nodes.each do |node| -%>server <%= node[‘hostname’] %><% end -%>
  • Nagios Demo•Download nagios server cookbooks•Install nagios server•Create fake nodes
  • knife cookbook site install nagiosknife cookbook upload -acd chef-repoknife role from file monitoring.jsonknife data bag create usersknife data bag from file users btm.jsonknife node run list add chef-demo-server role[monitoring]sudo chef-clienthttp://chef-demo-server/nagios3/for n in {1..5} ; do knife node from file fake${n}.json ; donesudo chef-clientknife data bag create nagios_hostgroupsknife data bag from file nagios_hostgroups hp_systems.jsonsudo chef-client
  • Questions?There is lots more to learn about Chef at http://